diff --git a/lib/browser.js b/lib/browser.js index 37b1af52d..fad880f5c 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,10 +1,10 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Neon=t():e.Neon=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=80)}([function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var u=f*a,c=e.min(4*u,i);if(u){for(var h=0;h1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(t%1!=0)throw new Error("size must be a whole integer");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");t*=2;var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=w(n)),n}),w=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;if("number"!=typeof e)throw new Error("num must be numeric");if(t%1!=0)throw new Error("size must be a whole integer");return new x(e.toFixed(8)).toReverseHex().slice(0,2*t)},t.fixed82num=function(e){return k(e),""===e?0:x.fromReverseHex(e).toNumber()},t.num2VarInt=function(e){return e<253?y(e):e<=65535?"fd"+y(e,2,!0):e<=4294967295?"fe"+y(e,4,!0):"ff"+y(e,8,!0)},t.hexXor=function(e,t){if(k(e),k(t),e.length!==t.length)throw new Error("strings are disparate lengths");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t}),_=/^([0-9A-Fa-f]{2})*$/,S=t.isHex=function(e){try{return _.test(e)}catch(e){return!1}},k=t.ensureHex=function(e){if(!S(e))throw new Error("Expected a hexstring but got "+e)},x=(t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.str=t,this.pter=0}return f(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(w(this.read(2)),16):254===e?e=parseInt(w(this.read(4)),16):255===e&&(e=parseInt(w(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e),r=(0,c.SHA256)(t);return(0,c.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e),r=(0,c.SHA256)(t);return(0,c.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e);return(0,c.SHA256)(t).toString()},t.Fixed8=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return o(this,t),"number"==typeof e&&(e=e.toFixed(8)),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),f(t,[{key:"toHex",value:function(){var e=this.mul(1e8).round().toString(16);return"0".repeat(16-e.length)+e}},{key:"toReverseHex",value:function(){return w(this.toHex())}},{key:p.default.inspect.custom,value:function(e,t){return this.toFixed(8)}},{key:"ceil",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ceil",this).call(this))}},{key:"floor",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"floor",this).call(this))}},{key:"round",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"round",this).call(this,e,r))}},{key:"div",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.dividedBy(e,t)}},{key:"dividedBy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dividedBy",this).call(this,e,r))}},{key:"mul",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.times(e,t)}},{key:"times",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"times",this).call(this,e,r))}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.plus(e,t)}},{key:"plus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"plus",this).call(this,e,r))}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.minus(e,t)}},{key:"minus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"minus",this).call(this,e,r))}}],[{key:"fromHex",value:function(e){return new t(e,16).div(1e8)}},{key:"fromReverseHex",value:function(e){return this.fromHex(w(e))}}]),t}(l.default))},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(16))}(0,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc,f=(s.Utf8,s.Base64),u=r.algo,c=u.EvpKDF,h=n.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?k:w}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),l=(n.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),d=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=l.CBC=function(){function e(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else var a=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},m=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:p,padding:v}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=r.format={},y=g.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},S=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=c.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},k=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654",TEST_NXT:"0b6c1f919e95fe61c17a7612aebfaf4fda3a2214",TEST_RHTT4:"f9572c5b119a6b5775a6af07f1cef5d310038f55"},t.TEST_NXT_ADDRESS="AHcLAfnvzzHyuPPULeXrXZ6RK3Hkdvi1qi",t.DEFAULT_RPC={MAIN:"https://seed1.neo.org:10331",TEST:"https://seed1.neo.org:20331"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.DEFAULT_ACCOUNT_CONTRACT={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=r(7),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(168),a=n(i),o=r(169),s=n(o);a.default.setDefaultLevel("silent"),a.default.setAll=function(e){Object.keys(a.default.getLoggers()).map(function(t){a.default.getLogger(t).setLevel(e)})};var f=function(e,t){var r=(new Date).toUTCString();return e=e.toUpperCase(),"["+r+"] ("+t+") "+e+": "};t.default=function(e){var t=a.default.getLogger(e);return s.default.apply(t,{format:f}),t};t.logger=a.default},function(e,t,r){"use strict";(function(e){function n(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return K(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,f/=2,r/=2}var u;if(i){var c=-1;for(u=r;us&&(r=s-f),u=r;u>=0;u--){for(var h=!0,l=0;li&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var f,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:f=e[i+1],128==(192&f)&&(h=(31&a)<<6|63&f)>127&&(o=h);break;case 3:f=e[i+1],u=e[i+2],128==(192&f)&&128==(192&u)&&(h=(15&a)<<12|(63&f)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:f=e[i+1],u=e[i+2],c=e[i+3],128==(192&f)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&f)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return T(n)}function T(e){var t=e.length;if(t<=J)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function L(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return i||L(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return i||L(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function U(e){if(e=D(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function D(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Y(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function W(e){return G.toByteArray(U(e))}function X(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e){return e!==e}/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Neon=t():e.Neon=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=80)}([function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var u=f*a,c=e.min(4*u,i);if(u){for(var h=0;h1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(t%1!=0)throw new Error("size must be a whole integer");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");t*=2;var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=w(n)),n}),w=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;if("number"!=typeof e)throw new Error("num must be numeric");if(t%1!=0)throw new Error("size must be a whole integer");return new x(e.toFixed(8)).toReverseHex().slice(0,2*t)},t.fixed82num=function(e){return k(e),""===e?0:x.fromReverseHex(e).toNumber()},t.num2VarInt=function(e){return e<253?y(e):e<=65535?"fd"+y(e,2,!0):e<=4294967295?"fe"+y(e,4,!0):"ff"+y(e,8,!0)},t.hexXor=function(e,t){if(k(e),k(t),e.length!==t.length)throw new Error("strings are disparate lengths");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t}),_=/^([0-9A-Fa-f]{2})*$/,S=t.isHex=function(e){try{return _.test(e)}catch(e){return!1}},k=t.ensureHex=function(e){if(!S(e))throw new Error("Expected a hexstring but got "+e)},x=(t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.str=t,this.pter=0}return f(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(w(this.read(2)),16):254===e?e=parseInt(w(this.read(4)),16):255===e&&(e=parseInt(w(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e),r=(0,c.SHA256)(t);return(0,c.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e),r=(0,c.SHA256)(t);return(0,c.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=c.enc.Hex.parse(e);return(0,c.SHA256)(t).toString()},t.Fixed8=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return o(this,t),"number"==typeof e&&(e=e.toFixed(8)),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),f(t,[{key:"toHex",value:function(){var e=this.mul(1e8).round().toString(16);return"0".repeat(16-e.length)+e}},{key:"toReverseHex",value:function(){return w(this.toHex())}},{key:p.default.inspect.custom,value:function(e,t){return this.toFixed(8)}},{key:"ceil",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ceil",this).call(this))}},{key:"floor",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"floor",this).call(this))}},{key:"round",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"round",this).call(this,e,r))}},{key:"div",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.dividedBy(e,t)}},{key:"dividedBy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dividedBy",this).call(this,e,r))}},{key:"mul",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.times(e,t)}},{key:"times",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"times",this).call(this,e,r))}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.plus(e,t)}},{key:"plus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"plus",this).call(this,e,r))}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.minus(e,t)}},{key:"minus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"minus",this).call(this,e,r))}}],[{key:"fromHex",value:function(e){return new t(e,16).div(1e8)}},{key:"fromReverseHex",value:function(e){return this.fromHex(w(e))}}]),t}(l.default))},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(17))}(0,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc,f=(s.Utf8,s.Base64),u=r.algo,c=u.EvpKDF,h=n.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?k:w}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),l=(n.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),d=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=l.CBC=function(){function e(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else var a=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},m=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:p,padding:v}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=r.format={},y=g.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},S=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=c.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},k=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654",TEST_NXT:"0b6c1f919e95fe61c17a7612aebfaf4fda3a2214",TEST_RHTT4:"f9572c5b119a6b5775a6af07f1cef5d310038f55"},t.TEST_NXT_ADDRESS="AHcLAfnvzzHyuPPULeXrXZ6RK3Hkdvi1qi",t.DEFAULT_RPC={MAIN:"https://seed1.neo.org:10331",TEST:"https://seed1.neo.org:20331"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.DEFAULT_ACCOUNT_CONTRACT={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=r(7),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(169),a=n(i),o=r(170),s=n(o);a.default.setDefaultLevel("silent"),a.default.setAll=function(e){Object.keys(a.default.getLoggers()).map(function(t){a.default.getLogger(t).setLevel(e)})};var f=function(e,t){var r=(new Date).toUTCString();return e=e.toUpperCase(),"["+r+"] ("+t+") "+e+": "};t.default=function(e){var t=a.default.getLogger(e);return s.default.apply(t,{format:f}),t};t.logger=a.default},function(e,t,r){"use strict";(function(e){function n(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return K(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,f/=2,r/=2}var u;if(i){var c=-1;for(u=r;us&&(r=s-f),u=r;u>=0;u--){for(var h=!0,l=0;li&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var f,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:f=e[i+1],128==(192&f)&&(h=(31&a)<<6|63&f)>127&&(o=h);break;case 3:f=e[i+1],u=e[i+2],128==(192&f)&&128==(192&u)&&(h=(15&a)<<12|(63&f)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:f=e[i+1],u=e[i+2],c=e[i+3],128==(192&f)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&f)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return T(n)}function T(e){var t=e.length;if(t<=J)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function L(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return i||L(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,i){return i||L(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function U(e){if(e=D(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function D(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Y(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function W(e){return G.toByteArray(U(e))}function X(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e){return e!==e}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var G=r(83),Q=r(84),$=r(48);t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return o(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),Q.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),Q.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),Q.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),Q.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):z(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):z(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1)for(var r=1;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function c(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function h(e,t){return e>>>t|e<<32-t}function l(e,t){return e<>>32-t}function d(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,u=t;return u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function S(e,t,r,n,i,a,o,s,f,u){var c=0,h=t;return h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}function k(e,t,r,n,i,a,o,s,f,u){return t+n+a+s+u>>>0}function x(e,t,r){return(t<<32-r|e>>>r)>>>0}function A(e,t,r){return(e<<32-r|t>>>r)>>>0}function M(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(15),T=r(1);t.inherits=T,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=u,t.split32=c,t.rotr32=h,t.rotl32=l,t.sum32=d,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=S,t.sum64_5_lo=k,t.rotr64_hi=x,t.rotr64_lo=A,t.shr64_hi=M,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function u(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;i=0|e.words[p],a=0|t.words[d],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}function c(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(e,t,r){return(new l).mulp(e,t,r)}function l(e,t){this.x=e,this.y=t}function d(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(110).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","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"],S=[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],k=[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];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=S[e],c=k[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var l=h.modn(c).toString(e);h=h.idivn(c),r=h.isZero()?l+r:_[u-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,u=new e(a),c=this.clone();if(f){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],p=8191&d,b=d>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,S=0|o[4],k=8191&S,x=S>>>13,A=0|o[5],M=8191&A,E=A>>>13,I=0|o[6],T=8191&I,P=I>>>13,R=0|o[7],B=8191&R,C=R>>>13,O=0|o[8],N=8191&O,j=O>>>13,z=0|o[9],L=8191&z,F=z>>>13,H=0|s[0],U=8191&H,D=H>>>13,q=0|s[1],K=8191&q,Y=q>>>13,V=0|s[2],W=8191&V,X=V>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,$=0|s[4],J=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,le=ce>>>13,de=0|s[9],pe=8191&de,be=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,D),i=i+Math.imul(l,U)|0,a=Math.imul(l,D);var ve=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,U),i=Math.imul(p,D),i=i+Math.imul(b,U)|0,a=Math.imul(b,D),n=n+Math.imul(h,K)|0,i=i+Math.imul(h,Y)|0,i=i+Math.imul(l,K)|0,a=a+Math.imul(l,Y)|0;var me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,U),i=Math.imul(m,D),i=i+Math.imul(g,U)|0,a=Math.imul(g,D),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Y)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,X)|0,i=i+Math.imul(l,W)|0,a=a+Math.imul(l,X)|0;var ge=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,U),i=Math.imul(w,D),i=i+Math.imul(_,U)|0,a=Math.imul(_,D),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,Y)|0,i=i+Math.imul(g,K)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(h,G)|0,i=i+Math.imul(h,Q)|0,i=i+Math.imul(l,G)|0,a=a+Math.imul(l,Q)|0;var ye=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,U),i=Math.imul(k,D),i=i+Math.imul(x,U)|0,a=Math.imul(x,D),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Y)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,ee)|0,i=i+Math.imul(l,J)|0,a=a+Math.imul(l,ee)|0;var we=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,U),i=Math.imul(M,D),i=i+Math.imul(E,U)|0,a=Math.imul(E,D),n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Y)|0,i=i+Math.imul(x,K)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(g,G)|0,a=a+Math.imul(g,Q)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,J)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0,i=i+Math.imul(l,re)|0,a=a+Math.imul(l,ne)|0;var _e=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,U),i=Math.imul(T,D),i=i+Math.imul(P,U)|0,a=Math.imul(P,D),n=n+Math.imul(M,K)|0,i=i+Math.imul(M,Y)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(k,X)|0,i=i+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,J)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(h,ae)|0,i=i+Math.imul(h,oe)|0,i=i+Math.imul(l,ae)|0,a=a+Math.imul(l,oe)|0;var Se=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=Math.imul(B,D),i=i+Math.imul(C,U)|0,a=Math.imul(C,D),n=n+Math.imul(T,K)|0,i=i+Math.imul(T,Y)|0,i=i+Math.imul(P,K)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,G)|0,i=i+Math.imul(k,Q)|0,i=i+Math.imul(x,G)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(h,fe)|0,i=i+Math.imul(h,ue)|0,i=i+Math.imul(l,fe)|0,a=a+Math.imul(l,ue)|0;var ke=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,U),i=Math.imul(N,D),i=i+Math.imul(j,U)|0,a=Math.imul(j,D),n=n+Math.imul(B,K)|0,i=i+Math.imul(B,Y)|0,i=i+Math.imul(C,K)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,i=i+Math.imul(P,W)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(M,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,ee)|0,i=i+Math.imul(x,J)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ue)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ue)|0,n=n+Math.imul(h,he)|0,i=i+Math.imul(h,le)|0,i=i+Math.imul(l,he)|0,a=a+Math.imul(l,le)|0;var xe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,U),i=Math.imul(L,D),i=i+Math.imul(F,U)|0,a=Math.imul(F,D),n=n+Math.imul(N,K)|0,i=i+Math.imul(N,Y)|0,i=i+Math.imul(j,K)|0,a=a+Math.imul(j,Y)|0,n=n+Math.imul(B,W)|0,i=i+Math.imul(B,X)|0,i=i+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,G)|0,i=i+Math.imul(T,Q)|0,i=i+Math.imul(P,G)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,i=i+Math.imul(E,J)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,i=i+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ue)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=i+Math.imul(p,le)|0,i=i+Math.imul(b,he)|0,a=a+Math.imul(b,le)|0,n=n+Math.imul(h,pe)|0,i=i+Math.imul(h,be)|0,i=i+Math.imul(l,pe)|0,a=a+Math.imul(l,be)|0;var Ae=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,K),i=Math.imul(L,Y),i=i+Math.imul(F,K)|0,a=Math.imul(F,Y),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(B,G)|0,i=i+Math.imul(B,Q)|0,i=i+Math.imul(C,G)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,ee)|0,i=i+Math.imul(P,J)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,oe)|0,i=i+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ue)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(m,he)|0,i=i+Math.imul(m,le)|0,i=i+Math.imul(g,he)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,W),i=Math.imul(L,X),i=i+Math.imul(F,W)|0,a=Math.imul(F,X),n=n+Math.imul(N,G)|0,i=i+Math.imul(N,Q)|0,i=i+Math.imul(j,G)|0,a=a+Math.imul(j,Q)|0,n=n+Math.imul(B,J)|0,i=i+Math.imul(B,ee)|0,i=i+Math.imul(C,J)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,i=i+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(M,ae)|0,i=i+Math.imul(M,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(k,fe)|0,i=i+Math.imul(k,ue)|0,i=i+Math.imul(x,fe)|0,a=a+Math.imul(x,ue)|0,n=n+Math.imul(w,he)|0,i=i+Math.imul(w,le)|0,i=i+Math.imul(_,he)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,G),i=Math.imul(L,Q),i=i+Math.imul(F,G)|0,a=Math.imul(F,Q),n=n+Math.imul(N,J)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(j,J)|0,a=a+Math.imul(j,ee)|0,n=n+Math.imul(B,re)|0,i=i+Math.imul(B,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(T,ae)|0,i=i+Math.imul(T,oe)|0,i=i+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(M,fe)|0,i=i+Math.imul(M,ue)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ue)|0,n=n+Math.imul(k,he)|0,i=i+Math.imul(k,le)|0,i=i+Math.imul(x,he)|0,a=a+Math.imul(x,le)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,J),i=Math.imul(L,ee),i=i+Math.imul(F,J)|0,a=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(j,re)|0,a=a+Math.imul(j,ne)|0,n=n+Math.imul(B,ae)|0,i=i+Math.imul(B,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(T,fe)|0,i=i+Math.imul(T,ue)|0,i=i+Math.imul(P,fe)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(M,he)|0,i=i+Math.imul(M,le)|0,i=i+Math.imul(E,he)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(k,pe)|0,i=i+Math.imul(k,be)|0,i=i+Math.imul(x,pe)|0,a=a+Math.imul(x,be)|0;var Te=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),i=Math.imul(L,ne),i=i+Math.imul(F,re)|0,a=Math.imul(F,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(j,ae)|0,a=a+Math.imul(j,oe)|0,n=n+Math.imul(B,fe)|0,i=i+Math.imul(B,ue)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(T,he)|0,i=i+Math.imul(T,le)|0,i=i+Math.imul(P,he)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(M,pe)|0,i=i+Math.imul(M,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Pe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,ae),i=Math.imul(L,oe),i=i+Math.imul(F,ae)|0,a=Math.imul(F,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ue)|0,i=i+Math.imul(j,fe)|0,a=a+Math.imul(j,ue)|0,n=n+Math.imul(B,he)|0,i=i+Math.imul(B,le)|0,i=i+Math.imul(C,he)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(T,pe)|0,i=i+Math.imul(T,be)|0,i=i+Math.imul(P,pe)|0,a=a+Math.imul(P,be)|0;var Re=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,fe),i=Math.imul(L,ue),i=i+Math.imul(F,fe)|0,a=Math.imul(F,ue),n=n+Math.imul(N,he)|0,i=i+Math.imul(N,le)|0,i=i+Math.imul(j,he)|0,a=a+Math.imul(j,le)|0,n=n+Math.imul(B,pe)|0,i=i+Math.imul(B,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Be=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,he),i=Math.imul(L,le),i=i+Math.imul(F,he)|0,a=Math.imul(F,le),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(j,pe)|0,a=a+Math.imul(j,be)|0;var Ce=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,pe),i=Math.imul(L,be),i=i+Math.imul(F,pe)|0,a=Math.imul(F,be);var Oe=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=Se,f[7]=ke,f[8]=xe,f[9]=Ae,f[10]=Me,f[11]=Ee,f[12]=Ie,f[13]=Te,f[14]=Pe,f[15]=Re,f[16]=Be,f[17]=Ce,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};Math.imul||(x=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?u(this,e,t):r<1024?c(this,e,t):h(this,e,t)},l.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},l.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var l;return l=0===t.cmpn(1)?i:o,l.cmpn(0)<0&&l.iadd(e),l},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},d.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},d.prototype.split=function(e,t){e.iushrn(this.n,0,t)},d.prototype.imulK=function(e){return e.imul(this.k)},i(p,d),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(A[e])return A[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return A[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var b=d,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(57)(e))},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||o(a,this)}function a(e){e.end()}var o=r(25),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=n;var f=r(22);f.inherits=r(1);var u=r(51),c=r(33);f.inherits(n,u);for(var h=s(c.prototype),l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=4294967295&r,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e,t,r){for(var n=[],a=0,o=0;o>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=o<<16|s<<8|f,c=0;c<4&&a+.75*c>>6*(3-c)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,u=s.Hasher,c=o.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=c.MD5=u.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var u=this._hash.words,c=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],S=e[t+11],k=e[t+12],x=e[t+13],A=e[t+14],M=e[t+15],E=u[0],I=u[1],T=u[2],P=u[3];E=r(E,I,T,P,c,7,h[0]),P=r(P,E,I,T,l,12,h[1]),T=r(T,P,E,I,d,17,h[2]),I=r(I,T,P,E,p,22,h[3]),E=r(E,I,T,P,b,7,h[4]),P=r(P,E,I,T,v,12,h[5]),T=r(T,P,E,I,m,17,h[6]),I=r(I,T,P,E,g,22,h[7]),E=r(E,I,T,P,y,7,h[8]),P=r(P,E,I,T,w,12,h[9]),T=r(T,P,E,I,_,17,h[10]),I=r(I,T,P,E,S,22,h[11]),E=r(E,I,T,P,k,7,h[12]),P=r(P,E,I,T,x,12,h[13]),T=r(T,P,E,I,A,17,h[14]),I=r(I,T,P,E,M,22,h[15]),E=n(E,I,T,P,l,5,h[16]),P=n(P,E,I,T,m,9,h[17]),T=n(T,P,E,I,S,14,h[18]),I=n(I,T,P,E,c,20,h[19]),E=n(E,I,T,P,v,5,h[20]),P=n(P,E,I,T,_,9,h[21]),T=n(T,P,E,I,M,14,h[22]),I=n(I,T,P,E,b,20,h[23]),E=n(E,I,T,P,w,5,h[24]),P=n(P,E,I,T,A,9,h[25]),T=n(T,P,E,I,p,14,h[26]),I=n(I,T,P,E,y,20,h[27]),E=n(E,I,T,P,x,5,h[28]),P=n(P,E,I,T,d,9,h[29]),T=n(T,P,E,I,g,14,h[30]),I=n(I,T,P,E,k,20,h[31]),E=i(E,I,T,P,v,4,h[32]),P=i(P,E,I,T,y,11,h[33]),T=i(T,P,E,I,S,16,h[34]),I=i(I,T,P,E,A,23,h[35]),E=i(E,I,T,P,l,4,h[36]),P=i(P,E,I,T,b,11,h[37]),T=i(T,P,E,I,g,16,h[38]),I=i(I,T,P,E,_,23,h[39]),E=i(E,I,T,P,x,4,h[40]),P=i(P,E,I,T,c,11,h[41]),T=i(T,P,E,I,p,16,h[42]),I=i(I,T,P,E,m,23,h[43]),E=i(E,I,T,P,w,4,h[44]),P=i(P,E,I,T,k,11,h[45]),T=i(T,P,E,I,M,16,h[46]),I=i(I,T,P,E,d,23,h[47]),E=a(E,I,T,P,c,6,h[48]),P=a(P,E,I,T,g,10,h[49]),T=a(T,P,E,I,A,15,h[50]),I=a(I,T,P,E,v,21,h[51]),E=a(E,I,T,P,k,6,h[52]),P=a(P,E,I,T,p,10,h[53]),T=a(T,P,E,I,_,15,h[54]),I=a(I,T,P,E,l,21,h[55]),E=a(E,I,T,P,y,6,h[56]),P=a(P,E,I,T,M,10,h[57]),T=a(T,P,E,I,m,15,h[58]),I=a(I,T,P,E,x,21,h[59]),E=a(E,I,T,P,b,6,h[60]),P=a(P,E,I,T,S,10,h[61]),T=a(T,P,E,I,d,15,h[62]),I=a(I,T,P,E,w,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+I|0,u[2]=u[2]+T|0,u[3]=u[3]+P|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 a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,u=0;u<4;u++){var c=f[u];f[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=u._createHelper(l),o.HmacMD5=u._createHmacHelper(l)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TxAttrUsage=t.Transaction=void 0;var a=r(68);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(28);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(44);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=r(171),u=i(f),c=n(a),h=n(o),l=n(s),d=r(71),p=i(d),b={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){e.exports=r(176)},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomArray=t.generatePrivateKey=t.generateSignature=t.getScriptHashFromAddress=t.getAddressFromScriptHash=t.getScriptHashFromPublicKey=t.getVerificationScriptFromPublicKey=t.getPublicKeyFromPrivateKey=t.getWIFFromPrivateKey=t.getPrivateKeyFromWIF=t.getPublicKeyUnencoded=t.getPublicKeyEncoded=void 0;var i=r(85),a=n(i),o=r(8),s=r(36),f=n(s),u=r(2),c=r(4),h=r(158),l=n(h),d=new o.ec("p256"),p=t.getPublicKeyEncoded=function(e){var t=(0,u.hexstring2ab)(e);return t[64]%2==1?"03"+(0,u.ab2hexstring)(t.slice(1,33)):"02"+(0,u.ab2hexstring)(t.slice(1,33))},b=(t.getPublicKeyUnencoded=function(e){return d.keyFromPublic(e,"hex").getPublic().encode("hex")},t.getPrivateKeyFromWIF=function(e){return(0,u.ab2hexstring)(a.default.decode(e,128).privateKey)},t.getWIFFromPrivateKey=function(t){return a.default.encode(128,e.from(t,"hex"),!0)},t.getPublicKeyFromPrivateKey=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,u.reverseHex)((0,u.hash160)(t))},t.getAddressFromScriptHash=function(t){t=(0,u.reverseHex)(t);var r=(0,u.hash256)(c.ADDR_VERSION+t).substr(0,8);return f.default.encode(e.from(c.ADDR_VERSION+t+r,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,u.ab2hexstring)(f.default.decode(e));return(0,u.reverseHex)(t.substr(2,40))},t.generateSignature=function(t,r){var n=(0,u.sha256)(t),i=e.from(n,"hex"),a=new o.ec("p256"),s=a.sign(i,r,null);return e.concat([s.r.toArrayLike(e,"be",32),s.s.toArrayLike(e,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,u.ab2hexstring)((0,l.default)(32))},t.generateRandomArray=function(e){return(0,l.default)(e)}}).call(t,r(7).Buffer)},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,f,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,f=0;f0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){t=e.exports=r(51),t.Stream=t,t.Readable=t,t.Writable=r(33),t.Duplex=r(14),t.Transform=r(54),t.PassThrough=r(95)},function(e,t,r){"use strict";(function(t,n,i){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){E(t,e)}}function o(e){return O.from(e)}function s(e){return O.isBuffer(e)||e instanceof N}function f(){}function u(e,t){T=T||r(14),e=e||{},this.objectMode=!!e.objectMode,t instanceof T&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){g(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function c(e){if(T=T||r(14),!(z.call(c,this)||this instanceof T))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),C.call(this)}function h(e,t){var r=new Error("write after end");e.emit("error",r),I(t,r)}function l(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),I(n,a),i=!1),i}function d(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=O.from(t,r)),t}function p(e,t,r,n,i,a){if(!r){var o=d(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1?n:I;c.WritableState=u;var R=r(22);R.inherits=r(1);var B={deprecate:r(94)},C=r(52),O=r(5).Buffer,N=i.Uint8Array||function(){},j=r(53);R.inherits(c,C),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:B.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var z;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||e&&e._writableState instanceof u}})):z=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=s(e)&&!n.objectMode;return a&&!O.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=f),n.ended?h(this,r):(a||l(this,n,e,r))&&(n.pendingcb++,i=p(this,n,a,e,t,r)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||M(this,n,r)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=j.destroy,c.prototype._undestroy=j.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(10),r(34).setImmediate,r(17))},function(e,t,r){function n(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new n(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(93),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,r){"use strict";function n(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=n(e);if("string"!=typeof t&&(g.isEncoding===y||!y(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=l,this.end=d,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=p,this.end=b,t=3;break;default:return this.write=v,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function f(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}function u(e){var t=this.lastTotal-this.lastNeed,r=f(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function p(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function b(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var g=r(5).Buffer,y=g.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>>31}var h=(n<<5|n>>>27)+f+o[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,u=0;u=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),f(n,e,n.depth)}function a(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function o(e,t){return e}function s(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function f(e,r,n){if(e.customInspect&&r&&M(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=f(e,i,n)),i}var a=u(e,r);if(a)return a;var o=Object.keys(r),b=s(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),A(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(r);if(0===o.length){if(M(r)){var v=r.name?": "+r.name:"";return e.stylize("[Function"+v+"]","special")}if(S(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return c(r)}var m="",g=!1,w=["{","}"];if(p(r)&&(g=!0,w=["[","]"]),M(r)){m=" [Function"+(r.name?": "+r.name:"")+"]"}if(S(r)&&(m=" "+RegExp.prototype.toString.call(r)),x(r)&&(m=" "+Date.prototype.toUTCString.call(r)),A(r)&&(m=" "+c(r)),0===o.length&&(!g||0==r.length))return w[0]+m+w[1];if(n<0)return S(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var _;return _=g?h(e,r,n,b,o):o.map(function(t){return l(e,r,n,b,t,g)}),e.seen.pop(),d(_,m,w)}function u(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i){for(var a=[],o=0,s=t.length;o-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function p(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return null==e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function S(e){return k(e)&&"[object RegExp]"===I(e)}function k(e){return"object"==typeof e&&null!==e}function x(e){return k(e)&&"[object Date]"===I(e)}function A(e){return k(e)&&("[object Error]"===I(e)||e instanceof Error)}function M(e){return"function"==typeof e}function E(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function I(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}function P(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var B=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return f.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,c.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,c.decrypt)(this.encrypted,e,t),this._updateContractScript(),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:Symbol.toStringTag,get:function(){return"Account"}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=f.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=f.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=f.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=f.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=f.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=f.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClaimItem=t.Coin=t.AssetBalance=void 0;var n=r(2),i=(t.AssetBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{balance:e.balance?new n.Fixed8(e.balance):new n.Fixed8(0),unspent:e.unspent?e.unspent.map(function(e){return i(e)}):[],spent:e.spent?e.spent.map(function(e){return i(e)}):[],unconfirmed:e.unconfirmed?e.unconfirmed.map(function(e){return i(e)}):[]}},t.Coin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{index:e.index||0,txid:e.txid||"",value:e.value?new n.Fixed8(e.value):new n.Fixed8(0)}});t.ClaimItem=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{claim:e.claim?new n.Fixed8(e.claim):new n.Fixed8(0),txid:e.txid||"",index:e.index||0,value:e.value||0,start:e.start?new n.Fixed8(e.start):null,end:e.end?new n.Fixed8(e.end):null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(2),i=r(28),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},l=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},d=function(e){return{script:e.script||"",gas:e.gas||0}};t.serializeExclusive={2:o,128:u,209:l},t.deserializeExclusive={2:a,128:f,209:h},t.getExclusive={2:s,128:c,209:d}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(172);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(70),o=n(a),s=r(69),f=n(s),u=r(173),c=n(u),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s}).call(t,r(10))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getAPIEndpoint=t.name=void 0;var i=r(29),a=n(i),o=r(11),s=r(21),f=r(24),u=r(4),c=r(2),h=r(6),l=n(h),d=(0,l.default)("api"),p=(t.name="neonDB",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}}),b=t.getBalance=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/balance/"+t).then(function(r){var n=new o.Balance({net:e,address:r.data.address});return Object.keys(r.data).map(function(e){"net"!==e&&"address"!==e&&n.addAsset(e,r.data[e])}),d.info("Retrieved Balance for "+t+" from neonDB "+e),n})},v=t.getClaims=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){var n=r.data;return n.claims=n.claims.map(function(e){return{claim:new c.Fixed8(e.claim).div(1e8),index:e.index,txid:e.txid,start:new c.Fixed8(e.start),end:new c.Fixed8(e.end),value:e.value}}),d.info("Retrieved Claims for "+t+" from neonDB "+e),new o.Claims(n)})},m=(t.getMaxClaimAmount=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){return d.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neonDB "+e),new c.Fixed8(r.data.total_claim+r.data.total_unspent_claim).div(1e8)})},t.getRPCEndpoint=function(e){var t=p(e);return a.default.get(t+"/v2/network/nodes").then(function(e){var t=e.data.nodes.filter(function(e){return e.status}),r=0,n=[],i=!0,a=!1,o=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var u=s.value;u.block_height>r?(r=u.block_height,n=[u]):u.block_height===r&&n.push(u)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})});t.getTransactionHistory=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/history/"+t).then(function(r){return d.info("Retrieved History for "+t+" from neonDB "+e),r.data.history})},t.getWalletDBHeight=function(e){var t=p(e);return a.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){d.warn("doClaimAllGas will be deprecated in favor of claimGas");var n=new o.Account(t),i=m(e),a=v(e,n.address),u=void 0,c=void 0;return Promise.all([i,a]).then(function(e){c=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=s.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return u=e,f.Query.sendRawTransaction(u).execute(c)}).then(function(e){return!0===e.result?e.txid=u:d.error("Transaction failed: "+u.serialize()),e})},t.doMintTokens=function(e,t,r,n,i,a){d.warn("doMintTokens will be deprecated in favor of doInvoke");var h=new o.Account(r),l=[{assetId:u.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t,args:[]},v=m(e),g=b(e,h.address),y=void 0,w=void 0;return Promise.all([v,g]).then(function(e){w=e[0];var r=e[1],n=[{data:(0,c.reverseHex)(t),usage:s.TxAttrUsage.Script}],o=s.Transaction.createInvocationTx(r,l,p,i,{attributes:n});return a?a(o,h.publicKey):o.sign(h.privateKey)}).then(function(e){return y=e,f.Query.getContractState(t).execute(w)}).then(function(e){var t={invocationScript:"0000",verificationScript:e.result.script};return y.scripts.unshift(t),f.Query.sendRawTransaction(y).execute(w)}).then(function(e){return!0===e.result?e.txid=y.hash:d.error("Transaction failed: "+y.serialize()),e})},t.doSendAsset=function(e,t,r,n,i){d.warn("doSendAsset will be deprecated in favor of sendAsset");var a=new o.Account(r),c=new o.Account(t),h=m(e),l=b(e,a.address),p=Object.keys(n).map(function(e){return{assetId:u.ASSET_ID[e],value:n[e],scriptHash:c.scriptHash}}),v=void 0,g=void 0;return Promise.all([h,l]).then(function(e){g=e[0];var t=e[1],r=s.Transaction.createContractTx(t,p);return i?i(r,a.publicKey):r.sign(a.privateKey)}).then(function(e){return v=e,f.Query.sendRawTransaction(v).execute(g)}).then(function(e){return!0===e.result?e.txid=v.hash:d.error("Transaction failed: "+v.serialize()),e})}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";function n(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}var i=r(86),a=r(106);e.exports=a(n)},function(e,t,r){function n(){i.call(this)}e.exports=n;var i=r(31).EventEmitter;r(1)(n,i),n.Readable=r(32),n.Writable=r(96),n.Duplex=r(97),n.Transform=r(98),n.PassThrough=r(99),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function n(){u.readable&&u.resume&&u.resume()}function a(){c||(c=!0,e.end())}function o(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(f(),0===i.listenerCount(this,"error"))throw e}function f(){u.removeListener("data",r),e.removeListener("drain",n),u.removeListener("end",a),u.removeListener("close",o),u.removeListener("error",s),e.removeListener("error",s),u.removeListener("end",f),u.removeListener("close",f),e.removeListener("close",f)}var u=this;u.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(u.on("end",a),u.on("close",o));var c=!1;return u.on("error",s),e.on("error",s),u.on("end",f),u.on("close",f),e.on("close",f),e.emit("pipe",u),e}},function(e,t,r){"use strict";(function(t,n){function i(e){return z.from(e)}function a(e){return z.isBuffer(e)||e instanceof L}function o(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?O(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function s(e,t){C=C||r(14),e=e||{},this.objectMode=!!e.objectMode,t instanceof C&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new q,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(D||(D=r(35).StringDecoder),this.decoder=new D(e.encoding),this.encoding=e.encoding)}function f(e){if(C=C||r(14),!(this instanceof f))return new f(e);this._readableState=new s(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),j.call(this)}function u(e,t,r,n,a){var o=e._readableState;if(null===t)o.reading=!1,b(e,o);else{var s;a||(s=h(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===z.prototype||(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?c(e,o,t,!1):g(e,o)):c(e,o,t,!1))):n||(o.reading=!1)}return l(o)}function c(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&v(e)),g(e,t)}function h(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=d(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(U("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?B(m,e):m(e))}function m(e){U("emit readable"),e.emit("readable"),x(e)}function g(e,t){t.readingMore||(t.readingMore=!0,B(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=M(e,t.buffer,t.decoder),r}function M(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}function I(e,t){var r=z.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,B(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return U("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&T(this),null;var n=t.needReadable;U("need readable",n),(0===t.length||t.length-e0?A(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},f.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(e,t){function r(e,t){U("onunpipe"),e===l&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){U("onend"),e.end()}function a(){U("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",f),e.removeListener("unpipe",r),l.removeListener("end",i),l.removeListener("end",h),l.removeListener("data",s),m=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){U("ondata"),g=!1,!1!==e.write(t)||g||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==R(d.pipes,e))&&!m&&(U("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,g=!0),l.pause())}function f(t){U("onerror",t),h(),e.removeListener("error",f),0===N(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),h()}function c(){U("onfinish"),e.removeListener("close",u),h()}function h(){U("unpipe"),l.unpipe(e)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,b=p?i:h;d.endEmitted?B(b):l.once("end",b),e.on("unpipe",r);var v=w(l);e.on("drain",v);var m=!1,g=!1;return l.on("data",s),o(e,"error",f),e.once("close",u),e.once("finish",c),e.emit("pipe",l),d.flowing||(U("pipe resume"),l.resume()),e},f.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=r(1),h=r(18),l=r(5).Buffer,d=[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],p=new Array(64);c(n,h),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,c=0|this._c,h=0|this._d,l=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=u(t[m-2])+t[m-7]+f(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var y=v+s(l)+i(l,p,b)+d[g]+t[g]|0,w=o(r)+a(r,n,c)|0;v=b,b=p,p=l,l=h+y|0,h=c,c=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=c+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=l.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=m,p.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function l(e,t){return e>>>0>>0?1:0}var d=r(1),p=r(18),b=r(5).Buffer,v=[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],m=new Array(160);d(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,d=0|this._ch,p=0|this._dh,b=0|this._eh,m=0|this._fh,g=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,k=0|this._dl,x=0|this._el,A=0|this._fl,M=0|this._gl,E=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var T=t[I-30],P=t[I-30+1],R=f(T,P),B=u(P,T);T=t[I-4],P=t[I-4+1];var C=c(T,P),O=h(P,T),N=t[I-14],j=t[I-14+1],z=t[I-32],L=t[I-32+1],F=B+j|0,H=R+N+l(F,B)|0;F=F+O|0,H=H+C+l(F,O)|0,F=F+L|0,H=H+z+l(F,L)|0,t[I]=H,t[I+1]=F}for(var U=0;U<160;U+=2){H=t[U],F=t[U+1];var D=a(r,n,d),q=a(w,_,S),K=o(r,w),Y=o(w,r),V=s(b,x),W=s(x,b),X=v[U],Z=v[U+1],G=i(b,m,g),Q=i(x,A,M),$=E+W|0,J=y+V+l($,E)|0;$=$+Q|0,J=J+G+l($,Q)|0,$=$+Z|0,J=J+X+l($,Z)|0,$=$+F|0,J=J+H+l($,F)|0;var ee=Y+q|0,te=K+D+l(ee,Y)|0;y=g,E=M,g=m,M=A,m=b,A=x,x=k+$|0,b=p+J+l(x,k)|0,p=d,k=S,d=n,S=_,n=r,_=w,w=$+ee|0,r=J+te+l(w,$)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+x|0,this._fl=this._fl+A|0,this._gl=this._gl+M|0,this._hl=this._hl+E|0,this._ah=this._ah+r+l(this._al,w)|0,this._bh=this._bh+n+l(this._bl,_)|0,this._ch=this._ch+d+l(this._cl,S)|0,this._dh=this._dh+p+l(this._dl,k)|0,this._eh=this._eh+b+l(this._el,x)|0,this._fh=this._fh+m+l(this._fl,A)|0,this._gh=this._gh+g+l(this._gl,M)|0,this._hh=this._hh+y+l(this._hl,E)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=b.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function c(e){return l(e,17)^l(e,19)^e>>>10}var h=r(12),l=h.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=u,t.g1_256=c},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(12),a=r(23),o=r(59),s=r(15),f=i.sum32,u=i.sum32_4,c=i.sum32_5,h=o.ch32,l=o.maj32,d=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[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];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=u[d-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[d]=b+u[d-7]+m+u[d-16]}var g=s&c^~s&h,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=l+_+g+f[d]+u[d],k=w+y;l=h,h=c,c=s,s=o+S|0,o=a,a=i,i=n,n=S+k|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|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 e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=t()}();var h=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],h=r[6],l=r[7],d=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,S=s.low,k=f.high,x=f.low,A=h.high,M=h.low,E=l.high,I=l.low,T=d,P=p,R=b,B=v,C=m,O=g,N=y,j=w,z=_,L=S,F=k,H=x,U=A,D=M,q=E,K=I,Y=0;Y<80;Y++){var V=c[Y];if(Y<16)var W=V.high=0|e[t+2*Y],X=V.low=0|e[t+2*Y+1];else{var Z=c[Y-15],G=Z.high,Q=Z.low,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=c[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=c[Y-7],oe=ae.high,se=ae.low,fe=c[Y-16],ue=fe.high,ce=fe.low,X=J+se,W=$+oe+(X>>>0>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ce,W=W+ue+(X>>>0>>0?1:0);V.high=W,V.low=X}var he=z&F^~z&U,le=L&H^~L&D,de=T&R^T&C^R&C,pe=P&B^P&O^B&O,be=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),ve=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),me=(z>>>14|L<<18)^(z>>>18|L<<14)^(z<<23|L>>>9),ge=(L>>>14|z<<18)^(L>>>18|z<<14)^(L<<23|z>>>9),ye=u[Y],we=ye.high,_e=ye.low,Se=K+ge,ke=q+me+(Se>>>0>>0?1:0),Se=Se+le,ke=ke+he+(Se>>>0>>0?1:0),Se=Se+_e,ke=ke+we+(Se>>>0<_e>>>0?1:0),Se=Se+X,ke=ke+W+(Se>>>0>>0?1:0),xe=ve+pe,Ae=be+de+(xe>>>0>>0?1:0);q=U,K=D,U=F,D=H,F=z,H=L,L=j+Se|0,z=N+ke+(L>>>0>>0?1:0)|0,N=C,j=O,C=R,O=B,R=T,B=P,P=Se+xe|0,T=ke+Ae+(P>>>0>>0?1:0)|0}p=n.low=p+P,n.high=d+T+(p>>>0

>>0?1:0),v=i.low=v+B,i.high=b+R+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+C+(g>>>0>>0?1:0),w=o.low=w+j,o.high=y+N+(w>>>0>>0?1:0),S=s.low=S+L,s.high=_+z+(S>>>0>>0?1:0),x=f.low=x+H,f.high=k+F+(x>>>0>>0?1:0),M=h.low=M+D,h.high=A+U+(M>>>0>>0?1:0),I=l.low=I+K,l.high=E+q+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(h),r.HmacSHA512=i._createHmacHelper(h)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(36),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(2),o=r(30);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptAsync=t.decrypt=t.encryptAsync=t.encrypt=void 0;var i=r(49),a=n(i),o=r(62),s=r(160),f=n(s),u=r(167),c=n(u),h=r(42),l=n(h),d=r(2),p=r(4),b=r(6),v=n(b),m=(0,v.default)("wallet");m.warn("ScryptParams will be changing to use n,r,p in place of cost, blockSize, parallel. New standard will be preferred. DEFAULT_SCRYPT will use new standard upon major version bump.");var g=(t.encrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;n=g(n);var i={cost:n.n,blockSize:n.r,parallel:n.p},s=new l.default(t),u=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(s.address))).toString().slice(0,8),c=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(u,"hex"),i).toString("hex"),h=c.slice(0,64),b=c.slice(64),v=(0,d.hexXor)(s.privateKey,h),y=o.AES.encrypt(o.enc.Hex.parse(v),o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),w=p.NEP_HEADER+p.NEP_FLAG+u+y.ciphertext.toString(),_=a.default.encode(e.from(w,"hex"));return m.info("Successfully encrypted key to "+_),_},t.encryptAsync=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(i,s){n=g(n);var f=n,u=f.n,h=f.r,b=f.p,v=new l.default(t),y=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(v.address))).toString().slice(0,8);(0,c.default)(e.from(r.normalize("NFC"),"utf8"),e.from(y,"hex"),u,h,b,64,function(t,r,n){if(null!=t)s(t);else if(n){var f=e.from(n).toString("hex"),u=f.slice(0,64),c=f.slice(64),h=(0,d.hexXor)(v.privateKey,u),l=o.AES.encrypt(o.enc.Hex.parse(h),o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),b=p.NEP_HEADER+p.NEP_FLAG+y+l.ciphertext.toString(),g=a.default.encode(e.from(b,"hex"));m.info("Successfully encrypted key to "+g),i(g)}})})},t.decrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;n=g(n);var i={cost:n.n,blockSize:n.r,parallel:n.p},s=(0,d.ab2hexstring)(a.default.decode(t)),u=s.substr(6,8),c=s.substr(-64),h=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(u,"hex"),i).toString("hex"),b=h.slice(0,64),v=h.slice(64),y={ciphertext:o.enc.Hex.parse(c),salt:""},w=o.AES.decrypt(y,o.enc.Hex.parse(v),{mode:o.mode.ECB,padding:o.pad.NoPadding}),_=(0,d.hexXor)(w.toString(),b),S=new l.default(_);if(u!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(S.address))).toString().slice(0,8))throw new Error("Wrong Password!");return m.info("Successfully decrypted "+t),S.WIF},t.decryptAsync=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(i,s){n=g(n);var f=n,u=f.n,h=f.r,p=f.p,b=(0,d.ab2hexstring)(a.default.decode(t)),v=b.substr(6,8),y=b.substr(-64);(0,c.default)(e.from(r.normalize("NFC"),"utf8"),e.from(v,"hex"),u,h,p,64,function(r,n,a){if(null!=r)s(r);else if(a){var f=e.from(a).toString("hex"),u=f.slice(0,64),c=f.slice(64),h={ciphertext:o.enc.Hex.parse(y),salt:""},p=o.AES.decrypt(h,o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),b=(0,d.hexXor)(p.toString(),u),g=new l.default(b),w=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8);if(v!==w)throw new Error("Wrong Password!");m.info("Successfully decrypted "+t),i(g.WIF)}})})},function(e){var t=Object.assign({},p.DEFAULT_SCRYPT,e);return{n:t.n||t.cost,r:t.r||t.blockSize,p:t.p||t.parallel}})}).call(t,r(7).Buffer)},function(e,t,r){(function(t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?t("","utf8"):e instanceof t?e:"string"==typeof e?new t(e,"utf8"):new t(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:u(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function u(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r}).call(t,r(7).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(2),i=r(11),a=r(44),o=r(4),s=r(28),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),u=r(6),c=function(e){return e&&e.__esModule?e:{default:e}}(u),h=(0,c.default)("tx"),l=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var i=t.reduce(function(e,t){return e[t.assetId]?e[t.assetId]=e[t.assetId].add(t.value):e[t.assetId]=t.value,e},{});return r=new n.Fixed8(r),r.gt(0)&&(i[o.ASSET_ID.GAS]?i[o.ASSET_ID.GAS]=i[o.ASSET_ID.GAS].add(r):i[o.ASSET_ID.GAS]=r),Object.keys(i).map(function(t){var r=i[t],n=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(n))throw new Error("This balance does not contain any "+n+"!");var a=e.assets[n];if(a.balance.lt(r))throw new Error("Insufficient "+o.ASSETS[t]+"! Need "+r.toString()+" but only found "+a.balance.toString());return l(a,r,t,e.address)}).reduce(function(e,t){return{inputs:e.inputs.concat(t.inputs),change:e.change.concat(t.change)}},{inputs:[],change:[]})},function(e,t,r,a){e.unspent.sort(function(e,t){return e.value.sub(t.value)});for(var s=0,f=new n.Fixed8(0);f.lt(t);){if((s+=1)>e.unspent.length)throw new Error("Insufficient "+o.ASSETS[r]+"! Reached end of unspent coins! "+e.unspent.length);f=f.add(e.unspent[s-1].value)}var u=[];return f.gt(t)&&u.push({assetId:r,value:f.sub(t),scriptHash:(0,i.getScriptHashFromAddress)(a)}),{inputs:e.unspent.slice(0,s).map(function(e){return{prevHash:e.txid,prevIndex:e.index}}),change:u}}),d=t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var u,c=e.attributes[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;r+=f.serializeTransactionAttribute(h)}}catch(e){o=!0,s=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var l=!0,d=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(l=(b=v.next()).done);l=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){d=!0,p=e}finally{try{!l&&v.return&&v.return()}finally{if(d)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,S=e.outputs[Symbol.iterator]();!(g=(_=S.next()).done);g=!0){var k=_.value;r+=f.serializeTransactionOutput(k)}}catch(e){y=!0,w=e}finally{try{!g&&S.return&&S.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var x=!0,A=!1,M=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(x=(E=I.next()).done);x=!0){var T=E.value;r+=f.serializeWitness(T)}}catch(e){A=!0,M=e}finally{try{!x&&I.return&&I.return()}finally{if(A)throw M}}}return r};t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]&&arguments[1];if((0,f.ensureHex)(e),40!==e.length)throw new Error("ScriptHash should be 20 bytes long!");return this.emit(t?c.default.TAILCALL:c.default.APPCALL,(0,f.reverseHex)(e))}},{key:"_emitArray",value:function(e){for(var t=e.length-1;t>=0;t--)this.emitPush(e[t]);return this.emitPush(e.length).emit(c.default.PACK)}},{key:"_emitString",value:function(e){(0,f.ensureHex)(e);var t=e.length/2;return t<=c.default.PUSHBYTES75?(this.str+=(0,f.num2hexstring)(t),this.str+=e):t<256?(this.emit(c.default.PUSHDATA1),this.str+=(0,f.num2hexstring)(t),this.str+=e):t<65536?(this.emit(c.default.PUSHDATA2),this.str+=(0,f.num2hexstring)(t,2),this.str+=e):(this.emit(c.default.PUSHDATA4),this.str+=(0,f.num2hexstring)(t,4),this.str+=e),this}},{key:"_emitNum",value:function(e){if(-1===e)return this.emit(c.default.PUSHM1);if(0===e)return this.emit(c.default.PUSH0);if(e>0&&e<=16)return this.emit(c.default.PUSH1-1+e);var t=(0,f.int2hex)(e);return this.emitPush((0,f.reverseHex)("0".repeat(16-t.length)+t))}},{key:"_emitParam",value:function(e){if(!e.type)throw new Error("No type available!");if(!l(e.value))throw new Error("Invalid value provided!");switch(e.type){case"String":return this._emitString((0,f.str2hexstring)(e.value));case"Boolean":return this.emit(e.value?c.default.PUSHT:c.default.PUSHF);case"Integer":return this._emitNum(e.value);case"ByteArray":return this._emitString(e.value);case"Array":return this._emitArray(e.value);case"Hash160":return this._emitString((0,f.reverseHex)(e.value))}}},{key:"emit",value:function(e,t){return this.str+=(0,f.num2hexstring)(e),t&&(this.str+=t),this}},{key:"emitAppCall",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.emitPush(r),t){for(var i="",a=0;a1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBlockHash",value:function(t){return new e({method:"getblockhash",params:[t]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;a=0&&e<=1&&(h=e)},t.setSwitchFreeze=function(e){l=!!e,c.info("core/setSwitchFreeze API switch is frozen: "+l)},function(){!l&&h>0&&(h-=.2,c.info("core API Switch increasing weight towards neoscan"))}),p=function(){!l&&h<1&&(h+=.2,c.info("core API Switch increasing weight towards neonDB"))};t.loadBalance=function(e,t){return Math.random()>h?e(t,s).then(function(e){return d(),e}).catch(function(){return p(),e(t,a)}):e(t,a).then(function(e){return p(),e}).catch(function(){return d(),e(t,s)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHistory=t.getWalletDBHeight=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getRPCEndpoint=t.getAPIEndpoint=t.name=void 0;var i=r(29),a=n(i),o=r(11),s=r(4),f=r(2),u=r(6),c=n(u),h=(0,c.default)("api"),l=(t.name="neoscan",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"https://api.neoscan.io/api/main_net";case"TestNet":return"https://neoscan-testnet.io/api/test_net";default:return e}}),d=(t.getRPCEndpoint=function(e){var t=l(e);return a.default.get(t+"/v1/get_all_nodes").then(function(t){var r=t.data,n=0,i=[],a=!0,o=!1,s=void 0;try{for(var f,u=r[Symbol.iterator]();!(a=(f=u.next()).done);a=!0){var c=f.value;c.height>n?(n=c.height,i=[c]):c.height===n&&i.push(c)}}catch(e){o=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(o)throw s}}var l=i[Math.floor(Math.random()*i.length)].url;return h.info("Best node from neoscan "+e+": "+l),l})},t.getBalance=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_balance/"+t).then(function(r){if(r.data.address!==t&&null===r.data.balance)return new o.Balance({address:r.data.address});var n=new o.Balance({address:r.data.address,net:e});return r.data.balance.map(function(e){n.addAsset(e.asset,{balance:e.amount,unspent:d(e.unspent)})}),h.info("Retrieved Balance for "+t+" from neoscan "+e),n})},t.getClaims=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){if(r.address!==t&&null===r.data.claimable)return new o.Claims({address:r.data.address});var n=p(r.data.claimable);return h.info("Retrieved Balance for "+t+" from neoscan "+e),new o.Claims({net:e,address:r.data.address,claims:n})})},t.getMaxClaimAmount=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){return h.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neoscan "+e),new f.Fixed8(r.data.unclaimed||0)})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),p=function(e){return e.map(function(e){return{start:new f.Fixed8(e.start_height),end:new f.Fixed8(e.end_height),index:e.n,claim:new f.Fixed8(e.unclaimed),txid:e.txid,value:e.value}})},b=(t.getWalletDBHeight=function(e){var t=l(e);return a.default.get(t+"/v1/get_height").then(function(e){return parseInt(e.data.height)})},t.getTransactionHistory=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_address_neon/"+t).then(function(r){return h.info("Retrieved History for "+t+" from neoscan "+e),b(r.data.txids)})},function(e){return e.map(function(e){var t=e.txid,r=e.block_height,n=e.balance,i=e.asset_moved,a=!1,o=!1,f=s.ASSETS.GAS,u=s.ASSETS.NEO;return n.forEach(function(e){var t=e.asset,r=e.amount;t===f&&(f=r),t===u&&(u=r)}),s.ASSET_ID.GAS===i&&(a=!0),s.ASSET_ID.NEO===i&&(o=!0),{GAS:f,NEO:u,block_index:r,gas_sent:a,neo_sent:o,txid:t}})})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.logging=t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(81),a=n(i),o=r(24),s=n(o),f=r(4),u=n(f),c=r(45),h=n(c),l=r(21),d=n(l),p=r(11),b=n(p),v=r(2),m=n(v),g=r(6),y=n(g),w=[h.default,d.default,b.default,a.default,s.default],_=w.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:u,u:m});t.default=_,t.api=a,t.rpc=s,t.sc=h,t.tx=d,t.wallet=b,t.u=m,t.CONST=u,t.logging=y},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(82);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(78);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(47),s=n(o),f=r(197),u=n(f),c=r(198),h=n(c),l=r(79),d=n(l),p=n(i);t.default={get:{price:u.getPrice,prices:u.getPrices,balance:s.getBalance,claims:s.getClaims,transactionHistory:s.getTransactionHistory,tokenBalance:h.getTokenBalance,tokenInfo:h.getTokenInfo,token:h.getToken},do:{sendAsset:s.doSendAsset,claimAllGas:s.doClaimAllGas,mintTokens:s.doMintTokens},sendAsset:function(e){return p.sendAsset(e)},claimGas:function(e){return p.claimGas(e)},doInvoke:function(e){return p.doInvoke(e)}},t.neonDB=s,t.cmc=u,t.nep5=h,t.neoscan=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxClaimAmountFrom=t.getWalletDBHeightFrom=t.getTransactionHistoryFrom=t.getRPCEndpointFrom=t.getClaimsFrom=t.getBalanceFrom=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.fillKeys=t.fillBalance=t.fillUrl=t.doInvoke=t.claimGas=t.sendAsset=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(11),a=r(4),o=r(24),s=r(21),f=r(2),u=r(78),c=r(6),h=function(e){return e&&e.__esModule?e:{default:e}}(c),l=(0,h.default)("api"),d=(t.sendAsset=function(e){return d(e).then(b).then(p).then(function(e){return v(e,"contract")}).then(function(e){return _(e)}).then(function(e){return m(e)}).then(function(e){return S(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,tx:e.tx};throw l.error("sendAsset failed with: "+t.message+". Dumping config",r),t})},t.claimGas=function(e){return d(e).then(b).then(function(t){return(0,u.loadBalance)(A,e)}).then(function(e){return v(e,"claim")}).then(function(e){return m(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,claims:e.claims,tx:e.tx};throw l.error("claimGas failed with "+t.message+". Dumping config",r),t})},t.doInvoke=function(e){return d(e).then(b).then(p).then(function(e){return v(e,"invocation")}).then(function(e){return _(e)}).then(function(e){return y(e)}).then(function(e){return m(e)}).then(function(e){return w(e)}).then(function(e){return S(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,script:e.script,gas:e.gas,tx:e.tx};throw l.error("doInvoke failed with "+t.message+". Dumping config",r),t})},t.fillUrl=function(e){return e.url?Promise.resolve(e):(0,u.loadBalance)(M,e).then(function(t){return Object.assign(e,{url:t})})}),p=t.fillBalance=function(e){return e.balance?Promise.resolve(e):(0,u.loadBalance)(x,e)},b=t.fillKeys=function(e){return e.account&&(e.address||(e.address=e.account.address),e.privateKey||e.signingFunction||(e.privateKey=e.account.privateKey),!e.publicKey&&e.signingFunction&&(e.publicKey=e.account.publicKey)),Promise.resolve(e)},v=t.createTx=function(e,t){if(e.tx)return e;"string"==typeof t&&(t=t.toLowerCase());var r=void 0;switch(t){case"claim":case 2:k(e,"claims"),r=s.Transaction.createClaimTx(e.address,e.claims);break;case"contract":case 128:k(e,"balance","intents"),r=s.Transaction.createContractTx(e.balance,e.intents,e.override);break;case"invocation":case 209:k(e,"balance","gas","script"),e.intents||(e.intents=[]),r=s.Transaction.createInvocationTx(e.balance,e.intents,e.script,e.gas,e.override);break;default:return Promise.reject(new Error("Tx Type not found: "+t))}return Promise.resolve(Object.assign(e,{tx:r}))},m=t.signTx=function(e){k(e,"tx");var t=void 0;if(e.signingFunction){var r=new i.Account(e.publicKey);t=e.signingFunction(e.tx,r.publicKey).then(function(e){return"string"==typeof e&&(e=s.Transaction.deserialize(e)),e})}else{if(!e.privateKey)return Promise.reject(new Error("Needs privateKey or signingFunction to sign!"));var n=new i.Account(e.privateKey);if(e.address!==n.address&&!e.sendingFromSmartContract)return Promise.reject(new Error("Private Key and Balance address does not match!"));t=Promise.resolve(e.tx.sign(n.privateKey))}return t.then(function(t){return Object.assign(e,{tx:t})})},g=t.sendTx=function(e){return k(e,"tx","url"),o.Query.sendRawTransaction(e.tx).execute(e.url).then(function(t){if(!0===t.result)t.txid=e.tx.hash,e.balance&&e.balance.applyTx(e.tx,!1);else{var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,claims:e.claims,script:e.script,gas:e.gas,tx:e.tx};l.error("Transaction failed for "+e.address+": "+e.tx.serialize(),r)}return Object.assign(e,{response:t})})},y=(t.makeIntent=function(e,t){var r=new i.Account(t);return Object.keys(e).map(function(t){return(0,s.TransactionOutput)({assetId:a.ASSET_ID[t],value:e[t],scriptHash:r.scriptHash})})},function(e){return e.override||(e.override={}),"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash&&e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(e.script.scriptHash)),Promise.resolve(e)}),w=function(e){return"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash?o.Query.getContractState(e.script.scriptHash).execute(e.url).then(function(t){var r={invocationScript:"0000",verificationScript:t.result.script};return e.tx.scripts.push(r),e}):Promise.resolve(e)},_=function(e){if(e.override||(e.override={}),e.sendingFromSmartContract){var t=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(t.scriptHash))}return Promise.resolve(e)},S=function(e){if(e.sendingFromSmartContract){var t=(0,i.getScriptHashFromAddress)(e.address);return o.Query.getContractState(t).execute(e.url).then(function(r){var n=r.result,a=n.parameters,o=n.script,s={invocationScript:"00".repeat(a.length),verificationScript:o},f=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);return parseInt(t,16)>parseInt(f.scriptHash,16)?e.tx.scripts.push(s):e.tx.scripts.unshift(s),e})}return Promise.resolve(e)},k=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function a(e){var t,r,i,a,o,s=e.length;a=n(e),o=new h(3*s/4-a),r=a>0?s-4:s;var f=0;for(t=0;t>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[f++]=255&i):1===a&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,r){for(var n,i=[],a=t;af?f:o+16383));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),a.push(i),a.join("")}t.byteLength=i,t.toByteArray=a,t.fromByteArray=f;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=l.length;d>1,c=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=l,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=l,c-=8);if(0===a)a=1-u;else{if(a===f)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,f,u=8*a-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),t+=o+h>=1?l/f:l*Math.pow(2,1-h),t*f>=2&&(o++,f/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*f-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*b}},function(e,t,r){(function(t){function n(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}function a(e,t){return n(s.decode(e),t)}function o(e,t,r){return"number"==typeof e?s.encode(i(e,t,r)):s.encode(i(e.version,e.privateKey,e.compressed))}var s=r(49);e.exports={decode:a,decodeRaw:n,encode:o,encodeRaw:i}}).call(t,r(7).Buffer)},function(e,t,r){"use strict";(function(t){function n(e){u.call(this,"digest"),this._hash=e,this.buffers=[]}function i(e){u.call(this,"digest"),this._hash=e}var a=r(1),o=r(87),s=r(89),f=r(100),u=r(105);a(n,u),n.prototype._update=function(e){this.buffers.push(e)},n.prototype._final=function(){var e=t.concat(this.buffers),r=this._hash(e);return this.buffers=null,r},a(i,u),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return e=e.toLowerCase(),"md5"===e?new n(o):new i("rmd160"===e||"ripemd160"===e?new s:f(e))}}).call(t,r(7).Buffer)},function(e,t,r){"use strict";function n(e,t){e[t>>5]|=128<>>9<<4)]=t;for(var r=1732584193,n=-271733879,i=-1732584194,c=271733878,h=0;h>16)+(t>>16)+(r>>16)<<16|65535&r}function c(e,t){return e<>>32-t}var h=r(88);e.exports=function(e){return h(e,n)}},function(e,t,r){"use strict";(function(t){function r(e){if(e.length%n!=0){var r=e.length+(n-e.length%n);e=t.concat([e,i],r)}for(var a=new Array(e.length>>>2),o=0,s=0;o>>32-t}function a(e,t,r,n,a,o,s,f){return i(e+(t^r^n)+o+s|0,f)+a|0}function o(e,t,r,n,a,o,s,f){return i(e+(t&r|~t&n)+o+s|0,f)+a|0}function s(e,t,r,n,a,o,s,f){return i(e+((t|~r)^n)+o+s|0,f)+a|0}function f(e,t,r,n,a,o,s,f){return i(e+(t&n|r&~n)+o+s|0,f)+a|0}function u(e,t,r,n,a,o,s,f){return i(e+(t^(r|~n))+o+s|0,f)+a|0}var c=r(1),h=r(90);c(n,h),n.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,c=this._c,h=this._d,l=this._e;r=a(r,n,c,h,l,e[0],0,11),c=i(c,10),l=a(l,r,n,c,h,e[1],0,14),n=i(n,10),h=a(h,l,r,n,c,e[2],0,15),r=i(r,10),c=a(c,h,l,r,n,e[3],0,12),l=i(l,10),n=a(n,c,h,l,r,e[4],0,5),h=i(h,10),r=a(r,n,c,h,l,e[5],0,8),c=i(c,10),l=a(l,r,n,c,h,e[6],0,7),n=i(n,10),h=a(h,l,r,n,c,e[7],0,9),r=i(r,10),c=a(c,h,l,r,n,e[8],0,11),l=i(l,10),n=a(n,c,h,l,r,e[9],0,13),h=i(h,10),r=a(r,n,c,h,l,e[10],0,14),c=i(c,10),l=a(l,r,n,c,h,e[11],0,15),n=i(n,10),h=a(h,l,r,n,c,e[12],0,6),r=i(r,10),c=a(c,h,l,r,n,e[13],0,7),l=i(l,10),n=a(n,c,h,l,r,e[14],0,9),h=i(h,10),r=a(r,n,c,h,l,e[15],0,8),c=i(c,10),l=o(l,r,n,c,h,e[7],1518500249,7),n=i(n,10),h=o(h,l,r,n,c,e[4],1518500249,6),r=i(r,10),c=o(c,h,l,r,n,e[13],1518500249,8),l=i(l,10),n=o(n,c,h,l,r,e[1],1518500249,13),h=i(h,10),r=o(r,n,c,h,l,e[10],1518500249,11),c=i(c,10),l=o(l,r,n,c,h,e[6],1518500249,9),n=i(n,10),h=o(h,l,r,n,c,e[15],1518500249,7),r=i(r,10),c=o(c,h,l,r,n,e[3],1518500249,15),l=i(l,10),n=o(n,c,h,l,r,e[12],1518500249,7),h=i(h,10),r=o(r,n,c,h,l,e[0],1518500249,12),c=i(c,10),l=o(l,r,n,c,h,e[9],1518500249,15),n=i(n,10),h=o(h,l,r,n,c,e[5],1518500249,9),r=i(r,10),c=o(c,h,l,r,n,e[2],1518500249,11),l=i(l,10),n=o(n,c,h,l,r,e[14],1518500249,7),h=i(h,10),r=o(r,n,c,h,l,e[11],1518500249,13),c=i(c,10),l=o(l,r,n,c,h,e[8],1518500249,12),n=i(n,10),h=s(h,l,r,n,c,e[3],1859775393,11),r=i(r,10),c=s(c,h,l,r,n,e[10],1859775393,13),l=i(l,10),n=s(n,c,h,l,r,e[14],1859775393,6),h=i(h,10),r=s(r,n,c,h,l,e[4],1859775393,7),c=i(c,10),l=s(l,r,n,c,h,e[9],1859775393,14),n=i(n,10),h=s(h,l,r,n,c,e[15],1859775393,9),r=i(r,10),c=s(c,h,l,r,n,e[8],1859775393,13),l=i(l,10),n=s(n,c,h,l,r,e[1],1859775393,15),h=i(h,10),r=s(r,n,c,h,l,e[2],1859775393,14),c=i(c,10),l=s(l,r,n,c,h,e[7],1859775393,8),n=i(n,10),h=s(h,l,r,n,c,e[0],1859775393,13),r=i(r,10),c=s(c,h,l,r,n,e[6],1859775393,6),l=i(l,10),n=s(n,c,h,l,r,e[13],1859775393,5),h=i(h,10),r=s(r,n,c,h,l,e[11],1859775393,12),c=i(c,10),l=s(l,r,n,c,h,e[5],1859775393,7),n=i(n,10),h=s(h,l,r,n,c,e[12],1859775393,5),r=i(r,10),c=f(c,h,l,r,n,e[1],2400959708,11),l=i(l,10),n=f(n,c,h,l,r,e[9],2400959708,12),h=i(h,10),r=f(r,n,c,h,l,e[11],2400959708,14),c=i(c,10),l=f(l,r,n,c,h,e[10],2400959708,15),n=i(n,10),h=f(h,l,r,n,c,e[0],2400959708,14),r=i(r,10),c=f(c,h,l,r,n,e[8],2400959708,15),l=i(l,10),n=f(n,c,h,l,r,e[12],2400959708,9),h=i(h,10),r=f(r,n,c,h,l,e[4],2400959708,8),c=i(c,10),l=f(l,r,n,c,h,e[13],2400959708,9),n=i(n,10),h=f(h,l,r,n,c,e[3],2400959708,14),r=i(r,10),c=f(c,h,l,r,n,e[7],2400959708,5),l=i(l,10),n=f(n,c,h,l,r,e[15],2400959708,6),h=i(h,10),r=f(r,n,c,h,l,e[14],2400959708,8),c=i(c,10),l=f(l,r,n,c,h,e[5],2400959708,6),n=i(n,10),h=f(h,l,r,n,c,e[6],2400959708,5),r=i(r,10),c=f(c,h,l,r,n,e[2],2400959708,12),l=i(l,10),n=u(n,c,h,l,r,e[4],2840853838,9),h=i(h,10),r=u(r,n,c,h,l,e[0],2840853838,15),c=i(c,10),l=u(l,r,n,c,h,e[5],2840853838,5),n=i(n,10),h=u(h,l,r,n,c,e[9],2840853838,11),r=i(r,10),c=u(c,h,l,r,n,e[7],2840853838,6),l=i(l,10),n=u(n,c,h,l,r,e[12],2840853838,8),h=i(h,10),r=u(r,n,c,h,l,e[2],2840853838,13),c=i(c,10),l=u(l,r,n,c,h,e[10],2840853838,12),n=i(n,10),h=u(h,l,r,n,c,e[14],2840853838,5),r=i(r,10),c=u(c,h,l,r,n,e[1],2840853838,12),l=i(l,10),n=u(n,c,h,l,r,e[3],2840853838,13),h=i(h,10),r=u(r,n,c,h,l,e[8],2840853838,14),c=i(c,10),l=u(l,r,n,c,h,e[11],2840853838,11),n=i(n,10),h=u(h,l,r,n,c,e[6],2840853838,8),r=i(r,10),c=u(c,h,l,r,n,e[15],2840853838,5),l=i(l,10),n=u(n,c,h,l,r,e[13],2840853838,6),h=i(h,10);var d=this._a,p=this._b,b=this._c,v=this._d,m=this._e;d=u(d,p,b,v,m,e[5],1352829926,8),b=i(b,10),m=u(m,d,p,b,v,e[14],1352829926,9),p=i(p,10),v=u(v,m,d,p,b,e[7],1352829926,9),d=i(d,10),b=u(b,v,m,d,p,e[0],1352829926,11),m=i(m,10),p=u(p,b,v,m,d,e[9],1352829926,13),v=i(v,10),d=u(d,p,b,v,m,e[2],1352829926,15),b=i(b,10),m=u(m,d,p,b,v,e[11],1352829926,15),p=i(p,10),v=u(v,m,d,p,b,e[4],1352829926,5),d=i(d,10),b=u(b,v,m,d,p,e[13],1352829926,7),m=i(m,10),p=u(p,b,v,m,d,e[6],1352829926,7),v=i(v,10),d=u(d,p,b,v,m,e[15],1352829926,8),b=i(b,10),m=u(m,d,p,b,v,e[8],1352829926,11),p=i(p,10),v=u(v,m,d,p,b,e[1],1352829926,14),d=i(d,10),b=u(b,v,m,d,p,e[10],1352829926,14),m=i(m,10),p=u(p,b,v,m,d,e[3],1352829926,12),v=i(v,10),d=u(d,p,b,v,m,e[12],1352829926,6),b=i(b,10),m=f(m,d,p,b,v,e[6],1548603684,9),p=i(p,10),v=f(v,m,d,p,b,e[11],1548603684,13),d=i(d,10),b=f(b,v,m,d,p,e[3],1548603684,15),m=i(m,10),p=f(p,b,v,m,d,e[7],1548603684,7),v=i(v,10),d=f(d,p,b,v,m,e[0],1548603684,12),b=i(b,10),m=f(m,d,p,b,v,e[13],1548603684,8),p=i(p,10),v=f(v,m,d,p,b,e[5],1548603684,9),d=i(d,10),b=f(b,v,m,d,p,e[10],1548603684,11),m=i(m,10),p=f(p,b,v,m,d,e[14],1548603684,7),v=i(v,10),d=f(d,p,b,v,m,e[15],1548603684,7),b=i(b,10),m=f(m,d,p,b,v,e[8],1548603684,12),p=i(p,10),v=f(v,m,d,p,b,e[12],1548603684,7),d=i(d,10),b=f(b,v,m,d,p,e[4],1548603684,6),m=i(m,10),p=f(p,b,v,m,d,e[9],1548603684,15),v=i(v,10),d=f(d,p,b,v,m,e[1],1548603684,13),b=i(b,10),m=f(m,d,p,b,v,e[2],1548603684,11),p=i(p,10),v=s(v,m,d,p,b,e[15],1836072691,9),d=i(d,10),b=s(b,v,m,d,p,e[5],1836072691,7),m=i(m,10),p=s(p,b,v,m,d,e[1],1836072691,15),v=i(v,10),d=s(d,p,b,v,m,e[3],1836072691,11),b=i(b,10),m=s(m,d,p,b,v,e[7],1836072691,8),p=i(p,10),v=s(v,m,d,p,b,e[14],1836072691,6),d=i(d,10),b=s(b,v,m,d,p,e[6],1836072691,6),m=i(m,10),p=s(p,b,v,m,d,e[9],1836072691,14),v=i(v,10),d=s(d,p,b,v,m,e[11],1836072691,12),b=i(b,10),m=s(m,d,p,b,v,e[8],1836072691,13),p=i(p,10),v=s(v,m,d,p,b,e[12],1836072691,5),d=i(d,10),b=s(b,v,m,d,p,e[2],1836072691,14),m=i(m,10),p=s(p,b,v,m,d,e[10],1836072691,13),v=i(v,10),d=s(d,p,b,v,m,e[0],1836072691,13),b=i(b,10),m=s(m,d,p,b,v,e[4],1836072691,7),p=i(p,10),v=s(v,m,d,p,b,e[13],1836072691,5),d=i(d,10),b=o(b,v,m,d,p,e[8],2053994217,15),m=i(m,10),p=o(p,b,v,m,d,e[6],2053994217,5),v=i(v,10),d=o(d,p,b,v,m,e[4],2053994217,8),b=i(b,10),m=o(m,d,p,b,v,e[1],2053994217,11),p=i(p,10),v=o(v,m,d,p,b,e[3],2053994217,14),d=i(d,10),b=o(b,v,m,d,p,e[11],2053994217,14),m=i(m,10),p=o(p,b,v,m,d,e[15],2053994217,6),v=i(v,10),d=o(d,p,b,v,m,e[0],2053994217,14),b=i(b,10),m=o(m,d,p,b,v,e[5],2053994217,6),p=i(p,10),v=o(v,m,d,p,b,e[12],2053994217,9),d=i(d,10),b=o(b,v,m,d,p,e[2],2053994217,12),m=i(m,10),p=o(p,b,v,m,d,e[13],2053994217,9),v=i(v,10),d=o(d,p,b,v,m,e[9],2053994217,12),b=i(b,10),m=o(m,d,p,b,v,e[7],2053994217,5),p=i(p,10),v=o(v,m,d,p,b,e[10],2053994217,15),d=i(d,10),b=o(b,v,m,d,p,e[14],2053994217,8),m=i(m,10),p=a(p,b,v,m,d,e[12],0,8),v=i(v,10),d=a(d,p,b,v,m,e[15],0,5),b=i(b,10),m=a(m,d,p,b,v,e[10],0,12),p=i(p,10),v=a(v,m,d,p,b,e[4],0,9),d=i(d,10),b=a(b,v,m,d,p,e[1],0,12),m=i(m,10),p=a(p,b,v,m,d,e[5],0,5),v=i(v,10),d=a(d,p,b,v,m,e[8],0,14),b=i(b,10),m=a(m,d,p,b,v,e[7],0,6),p=i(p,10),v=a(v,m,d,p,b,e[6],0,8),d=i(d,10),b=a(b,v,m,d,p,e[2],0,13),m=i(m,10),p=a(p,b,v,m,d,e[13],0,6),v=i(v,10),d=a(d,p,b,v,m,e[14],0,5),b=i(b,10),m=a(m,d,p,b,v,e[0],0,15),p=i(p,10),v=a(v,m,d,p,b,e[3],0,13),d=i(d,10),b=a(b,v,m,d,p,e[9],0,11),m=i(m,10),p=a(p,b,v,m,d,e[11],0,11),v=i(v,10);var g=this._b+c+v|0;this._b=this._c+h+m|0,this._c=this._d+l+d|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=g},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=n}).call(t,r(7).Buffer)},function(e,t,r){"use strict";(function(t){function n(e){i.call(this),this._block=new t(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var i=r(50).Transform;r(1)(n,i),n.prototype._transform=function(e,r,n){var i=null;try{"buffer"!==r&&(e=new t(e,r)),this.update(e)}catch(e){i=e}n(i)},n.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,r){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");t.isBuffer(e)||(e=new t(e,r||"binary"));for(var n=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},n.prototype._update=function(e){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=n}).call(t,r(7).Buffer)},function(e,t){},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){e.copy(t,r)}var a=r(5).Buffer;e.exports=function(){function e(){n(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)i(r.data,t,n),n+=r.data.length,r=r.next;return t},e}()},function(e,t,r){(function(e,t){!function(e,r){"use strict";function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>27}function a(e){return e<<30|e>>>2}function o(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var s=r(1),f=r(18),u=r(5).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);s(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,s=0|this._c,f=0|this._d,u=0|this._e,h=0;h<16;++h)t[h]=e.readInt32BE(4*h);for(;h<80;++h)t[h]=t[h-3]^t[h-8]^t[h-14]^t[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=i(r)+o(d,n,s,f)+u+t[l]+c[d]|0;u=f,f=s,s=a(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=f+this._d|0,this._e=u+this._e|0},n.prototype._hash=function(){var e=u.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=l,u.call(this,64,56)}function i(e){return e<<1|e>>>31}function a(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var f=r(1),u=r(18),c=r(5).Buffer,h=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);f(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,f=0|this._c,u=0|this._d,c=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=i(t[l-3]^t[l-8]^t[l-14]^t[l-16]);for(var d=0;d<80;++d){var p=~~(d/20),b=a(r)+s(p,n,f,u)+c+t[d]+h[p]|0;c=u,u=f,f=o(n),n=r,r=b}this._a=r+this._a|0,this._b=n+this._b|0,this._c=f+this._c|0,this._d=u+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var e=c.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=f,o.call(this,64,56)}var i=r(1),a=r(55),o=r(18),s=r(5).Buffer,f=new Array(64);i(n,a),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=f,o.call(this,128,112)}var i=r(1),a=r(56),o=r(18),s=r(5).Buffer,f=new Array(160);i(n,a),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=s.allocUnsafe(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=n},function(e,t,r){function n(e){a.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var i=r(5).Buffer,a=r(50).Transform,o=r(35).StringDecoder;r(1)(n,a),n.prototype.update=function(e,t,r){"string"==typeof e&&(e=i.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},n.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},n.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return e&&(t=this._toString(t,e,!0)),t},n.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=n},function(e,t,r){"use strict";var n=r(36),i=r(5).Buffer;e.exports=function(e){function t(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))}function r(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}function a(e){var t=n.decodeUnsafe(e);if(t)return r(t)}function o(t){var i=n.decode(t),a=r(i,e);if(!a)throw new Error("Invalid checksum");return a}return{encode:t,decode:o,decodeUnsafe:a}}},function(e,t,r){var n=r(5).Buffer;e.exports=function(e){function t(t){if(0===t.length)return"";for(var r=[0],n=0;n0;)r.push(a%o),a=a/o|0}for(var f="",u=0;0===t[u]&&u=0;--c)f+=e[r[c]];return f}function r(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.allocUnsafe(0);for(var t=[0],r=0;r>=8;for(;u>0;)t.push(255&u),u>>=8}for(var c=0;e[c]===s&&c=0;){var a;if(i.isOdd()){var o=i.andln(n-1);a=o>(n>>1)-1?(n>>1)-o:o,i.isubn(a)}else a=0;r.push(a);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,o=t.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var f=e.andln(7)+n&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var u;if(0==(1&o))u=0;else{var f=t.andln(7)+i&7;u=3!==f&&5!==f||2!==a?o:-o}r[1].push(u),2*n===s+1&&(n=1-n),2*i===u+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function a(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function o(e){return"string"==typeof e?f.toArray(e,"hex"):e}function s(e){return new u(e,"hex","le")}var f=t,u=r(13),c=r(15),h=r(58);f.assert=c,f.toArray=h.toArray,f.zero2=h.zero2,f.toHex=h.toHex,f.encode=h.encode,f.getNAF=n,f.getJSF=i,f.cachedProperty=a,f.parseBytes=o,f.intFromLE=s},function(e,t){},function(e,t,r){function n(e){this.rand=e}var i;if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,t){this.curve=e,this.type=t,this.precomputed=null}var a=r(13),o=r(8),s=o.utils,f=s.getNAF,u=s.getJSF,c=s.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(e,t){c(e.precomputed);var r=e._getDoubles(),n=f(t,1),i=(1<=o;t--)s=(s<<1)+n[t];a.push(s)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(var o=0;o=0;s--){for(var t=0;s>=0&&0===a[s];s--)t++;if(s>=0&&t++,o=o.dblp(t),s<0)break;var u=a[s];c(0!==u),o="affine"===e.type?u>0?o.mixedAdd(i[u-1>>1]):o.mixedAdd(i[-u-1>>1].neg()):u>0?o.add(i[u-1>>1]):o.add(i[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},n.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,h=0;h=1;h-=2){var p=h-1,b=h;if(1===a[p]&&1===a[b]){var v=[t[p],null,null,t[b]];0===t[p].y.cmp(t[b].y)?(v[1]=t[p].add(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg())):0===t[p].y.cmp(t[b].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].add(t[b].neg())):(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=u(r[p],r[b]);c=Math.max(g[0].length,c),s[p]=new Array(c),s[b]=new Array(c);for(var y=0;y=0;h--){for(var x=0;h>=0;){for(var A=!0,y=0;y=0&&x++,S=S.dblp(x),h<0)break;for(var y=0;y0?l=o[y][M-1>>1]:M<0&&(l=o[y][-M-1>>1].neg()),S="affine"===l.type?S.mixedAdd(l):S.add(l))}}for(var h=0;h=Math.ceil((e.bitLength()+1)/t.step)},i.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},n.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),f=i.mul(r.b),u=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:f.add(u).neg()}},n.prototype.pointFromX=function(e,t){e=new f(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.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(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},n.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(e){return e=new f(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},i.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},i.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},u(a,c.BasePoint),n.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),l=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(l)).redISub(a.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,d,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),u=f.redMul(o),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),l=s.redMul(c.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(h,l,d)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";function n(e){f.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,t,r){f.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(t,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(26),o=r(13),s=r(1),f=a.base,u=r(8),c=u.utils;s(n,f),e.exports=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},s(i,f.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},n.prototype.point=function(e,t){return new i(this,e,t)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,t){return new i(e,t[0],t[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=t.redSub(n),a=t.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(r),s=i.redMul(n),f=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,u)},i.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";function n(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,u.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function i(e,t,r,n,i){u.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(26),o=r(8),s=r(13),f=r(1),u=a.base,c=o.utils.assert;f(n,u),e.exports=n,n.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},n.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},n.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},n.prototype.pointFromX=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o)},n.prototype.pointFromY=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},n.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},f(i,u.BasePoint),n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},n.prototype.point=function(e,t,r,n){return new i(this,e,t,r,n)},i.fromJSON=function(e,t){return new i(e,t[0],t[1],t[2])},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),f=i.redMul(o),u=a.redMul(s),c=i.redMul(s),h=o.redMul(a);return this.curve.point(f,u,h,c)},i.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),s=o.redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),u=s.redSub(f).redISub(f);e=n.redSub(i).redISub(a).redMul(u),t=s.redMul(o.redSub(a)),r=s.redMul(u)}}else{var o=i.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=o.redSub(f).redSub(f);e=this.curve._mulC(n.redISub(o)).redMul(u),t=this.curve._mulC(o).redMul(i.redISub(a)),r=o.redMul(u)}return this.curve.point(e,t,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),u=a.redMul(o),c=s.redMul(f),h=a.redMul(f),l=o.redMul(s);return this.curve.point(u,c,l,h)},i.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),h=n.redMul(f).redMul(c);return this.curve.twisted?(t=n.redMul(u).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(u)):(t=n.redMul(u).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,t,r)},i.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},i.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},i.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},i.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},function(e,t,r){"use strict";function n(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new n(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}var a=t,o=r(37),s=r(8),f=s.utils.assert;a.PresetCurve=n,i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]});var u;try{u=r(124)}catch(e){u=void 0}i("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",u]})},function(e,t,r){"use strict";t.sha1=r(119),t.sha224=r(120),t.sha256=r(60),t.sha384=r(121),t.sha512=r(61)},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var i=r(12),a=r(23),o=r(59),s=i.rotl32,f=i.sum32,u=i.sum32_5,c=o.ft_1,h=a.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];i.inherits(n,h),e.exports=n,n.blockSize=512,n.outSize=160,n.hmacStrength=80,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},n.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},n.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),f=e.toArray("be",o),u=new a({hash:this.hash,entropy:s,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;!0;l++){var d=n.k?n.k(l):new i(u.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var m=d.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(m=m.umod(this.n),0!==m.cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new c({r:v,s:m,recoveryParam:g})}}}}}},n.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n),t=new c(t,"hex");var a=t.r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(e).umod(this.n),u=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var h=this.g.mulAdd(f,r.getPublic(),u);return!h.isInfinity()&&0===h.getX().umod(this.n).cmp(a)}var h=this.g.jmulAdd(f,r.getPublic(),u);return!h.isInfinity()&&h.eqXToP(a)},n.prototype.recoverPubKey=function(e,t,r,n){f((3&r)===r,"The recovery param is more than two bits"),t=new c(t,n);var a=this.n,o=new i(e),s=t.r,u=t.s,h=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var d=t.r.invm(a),p=a.sub(o).mul(d).umod(a),b=u.mul(d).umod(a);return this.g.mulAdd(p,s,b)},n.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new c(t,n),null!==t.recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var i=r(37),a=r(58),o=r(15);e.exports=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},n.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"}},function(e,t,r){"use strict";function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(h(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function i(){this.place=0}function a(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}var f=r(13),u=r(8),c=u.utils,h=c.assert;e.exports=n,n.prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new i;if(48!==e[r.place++])return!1;if(a(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=a(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=a(e,r);if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new f(o),this.s=new f(u),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,t.length),n=n.concat(t),n.push(2),s(n,r.length);var i=n.concat(r),a=[48];return s(a,i.length),a=a.concat(i),c.encode(a,e)}},function(e,t,r){"use strict";function n(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof n))return new n(e);var e=a.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}var i=r(37),a=r(8),o=a.utils,s=o.assert,f=o.parseBytes,u=r(130),c=r(131);e.exports=n,n.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},n.prototype.verify=function(e,t,r){e=f(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},n.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>>2]|=e[n]<<24-n%4*8;i.call(this,r,t)}else i.apply(this,arguments)}).prototype=n}}(),e.lib.WordArray})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return i.create(r,2*t)}};a.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],a=0;a>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a>>1]|=t(e.charCodeAt(a)<<16-a%2*16);return i.create(n,2*r)}}}(),e.enc.Utf16})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(63))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=t.algo,a=i.SHA256,o=i.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=a._createHelper(o),t.HmacSHA224=a._createHmacHelper(o)}(),e.SHA224})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27),r(64))}(0,function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),e.SHA384})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64,s=o.Word,f=r.algo,u=[],c=[],h=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,o=0;o<24;o++){for(var f=0,l=0,d=0;d<7;d++){if(1&a){var p=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=r[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var d=0;d<5;d++){for(var p=0,b=0,v=0;v<5;v++){var s=r[d+5*v];p^=s.high,b^=s.low}var m=l[d];m.high=p,m.low=b}for(var d=0;d<5;d++)for(var g=l[(d+4)%5],y=l[(d+1)%5],w=y.high,_=y.low,p=g.high^(w<<1|_>>>31),b=g.low^(_<<1|w>>>31),v=0;v<5;v++){var s=r[d+5*v];s.high^=p,s.low^=b}for(var S=1;S<25;S++){var s=r[S],k=s.high,x=s.low,A=u[S];if(A<32)var p=k<>>32-A,b=x<>>32-A;else var p=x<>>64-A,b=k<>>64-A;var M=l[c[S]];M.high=p,M.low=b}var E=l[0],I=r[0];E.high=I.high,E.low=I.low;for(var d=0;d<5;d++)for(var v=0;v<5;v++){var S=d+5*v,s=r[S],T=l[S],P=l[(d+1)%5+5*v],R=l[(d+2)%5+5*v];s.high=T.high^~P.high&R.high,s.low=T.low^~P.low&R.low}var s=r[0],B=h[f];s.high^=B.high,s.low^=B.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,f=s/8,u=[],c=0;c>>24)|4278255360&(l<<24|l>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(l)}return new i.init(u,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(d),r.HmacSHA3=a._createHmacHelper(d)}(Math),e.SHA3})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){/** @preserve +var G=r(83),Q=r(84),$=r(48);t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return o(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),Q.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),Q.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),Q.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),Q.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):z(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):z(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1)for(var r=1;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function c(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function h(e,t){return e>>>t|e<<32-t}function l(e,t){return e<>>32-t}function d(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,u=t;return u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function S(e,t,r,n,i,a,o,s,f,u){var c=0,h=t;return h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}function k(e,t,r,n,i,a,o,s,f,u){return t+n+a+s+u>>>0}function x(e,t,r){return(t<<32-r|e>>>r)>>>0}function A(e,t,r){return(e<<32-r|t>>>r)>>>0}function M(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(16),T=r(1);t.inherits=T,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=u,t.split32=c,t.rotr32=h,t.rotl32=l,t.sum32=d,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=S,t.sum64_5_lo=k,t.rotr64_hi=x,t.rotr64_lo=A,t.shr64_hi=M,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function u(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;i=0|e.words[p],a=0|t.words[d],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}function c(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(e,t,r){return(new l).mulp(e,t,r)}function l(e,t){this.x=e,this.y=t}function d(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(111).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","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"],S=[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],k=[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];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=S[e],c=k[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var l=h.modn(c).toString(e);h=h.idivn(c),r=h.isZero()?l+r:_[u-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,u=new e(a),c=this.clone();if(f){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],p=8191&d,b=d>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,S=0|o[4],k=8191&S,x=S>>>13,A=0|o[5],M=8191&A,E=A>>>13,I=0|o[6],T=8191&I,R=I>>>13,P=0|o[7],B=8191&P,C=P>>>13,O=0|o[8],N=8191&O,j=O>>>13,z=0|o[9],L=8191&z,H=z>>>13,F=0|s[0],U=8191&F,D=F>>>13,q=0|s[1],K=8191&q,Y=q>>>13,V=0|s[2],W=8191&V,X=V>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,$=0|s[4],J=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,le=ce>>>13,de=0|s[9],pe=8191&de,be=de>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,D),i=i+Math.imul(l,U)|0,a=Math.imul(l,D);var ve=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,U),i=Math.imul(p,D),i=i+Math.imul(b,U)|0,a=Math.imul(b,D),n=n+Math.imul(h,K)|0,i=i+Math.imul(h,Y)|0,i=i+Math.imul(l,K)|0,a=a+Math.imul(l,Y)|0;var me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,U),i=Math.imul(m,D),i=i+Math.imul(g,U)|0,a=Math.imul(g,D),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Y)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,X)|0,i=i+Math.imul(l,W)|0,a=a+Math.imul(l,X)|0;var ge=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,U),i=Math.imul(w,D),i=i+Math.imul(_,U)|0,a=Math.imul(_,D),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,Y)|0,i=i+Math.imul(g,K)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(h,G)|0,i=i+Math.imul(h,Q)|0,i=i+Math.imul(l,G)|0,a=a+Math.imul(l,Q)|0;var ye=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,U),i=Math.imul(k,D),i=i+Math.imul(x,U)|0,a=Math.imul(x,D),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Y)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,ee)|0,i=i+Math.imul(l,J)|0,a=a+Math.imul(l,ee)|0;var we=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,U),i=Math.imul(M,D),i=i+Math.imul(E,U)|0,a=Math.imul(E,D),n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Y)|0,i=i+Math.imul(x,K)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(g,G)|0,a=a+Math.imul(g,Q)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,J)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0,i=i+Math.imul(l,re)|0,a=a+Math.imul(l,ne)|0;var _e=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,U),i=Math.imul(T,D),i=i+Math.imul(R,U)|0,a=Math.imul(R,D),n=n+Math.imul(M,K)|0,i=i+Math.imul(M,Y)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(k,X)|0,i=i+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,J)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(h,ae)|0,i=i+Math.imul(h,oe)|0,i=i+Math.imul(l,ae)|0,a=a+Math.imul(l,oe)|0;var Se=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=Math.imul(B,D),i=i+Math.imul(C,U)|0,a=Math.imul(C,D),n=n+Math.imul(T,K)|0,i=i+Math.imul(T,Y)|0,i=i+Math.imul(R,K)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,G)|0,i=i+Math.imul(k,Q)|0,i=i+Math.imul(x,G)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(h,fe)|0,i=i+Math.imul(h,ue)|0,i=i+Math.imul(l,fe)|0,a=a+Math.imul(l,ue)|0;var ke=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,U),i=Math.imul(N,D),i=i+Math.imul(j,U)|0,a=Math.imul(j,D),n=n+Math.imul(B,K)|0,i=i+Math.imul(B,Y)|0,i=i+Math.imul(C,K)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,i=i+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(M,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,ee)|0,i=i+Math.imul(x,J)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ue)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ue)|0,n=n+Math.imul(h,he)|0,i=i+Math.imul(h,le)|0,i=i+Math.imul(l,he)|0,a=a+Math.imul(l,le)|0;var xe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,U),i=Math.imul(L,D),i=i+Math.imul(H,U)|0,a=Math.imul(H,D),n=n+Math.imul(N,K)|0,i=i+Math.imul(N,Y)|0,i=i+Math.imul(j,K)|0,a=a+Math.imul(j,Y)|0,n=n+Math.imul(B,W)|0,i=i+Math.imul(B,X)|0,i=i+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,G)|0,i=i+Math.imul(T,Q)|0,i=i+Math.imul(R,G)|0,a=a+Math.imul(R,Q)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,i=i+Math.imul(E,J)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,i=i+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ue)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=i+Math.imul(p,le)|0,i=i+Math.imul(b,he)|0,a=a+Math.imul(b,le)|0,n=n+Math.imul(h,pe)|0,i=i+Math.imul(h,be)|0,i=i+Math.imul(l,pe)|0,a=a+Math.imul(l,be)|0;var Ae=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,K),i=Math.imul(L,Y),i=i+Math.imul(H,K)|0,a=Math.imul(H,Y),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(B,G)|0,i=i+Math.imul(B,Q)|0,i=i+Math.imul(C,G)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,ee)|0,i=i+Math.imul(R,J)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,oe)|0,i=i+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ue)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(m,he)|0,i=i+Math.imul(m,le)|0,i=i+Math.imul(g,he)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,W),i=Math.imul(L,X),i=i+Math.imul(H,W)|0,a=Math.imul(H,X),n=n+Math.imul(N,G)|0,i=i+Math.imul(N,Q)|0,i=i+Math.imul(j,G)|0,a=a+Math.imul(j,Q)|0,n=n+Math.imul(B,J)|0,i=i+Math.imul(B,ee)|0,i=i+Math.imul(C,J)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,i=i+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(M,ae)|0,i=i+Math.imul(M,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(k,fe)|0,i=i+Math.imul(k,ue)|0,i=i+Math.imul(x,fe)|0,a=a+Math.imul(x,ue)|0,n=n+Math.imul(w,he)|0,i=i+Math.imul(w,le)|0,i=i+Math.imul(_,he)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,G),i=Math.imul(L,Q),i=i+Math.imul(H,G)|0,a=Math.imul(H,Q),n=n+Math.imul(N,J)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(j,J)|0,a=a+Math.imul(j,ee)|0,n=n+Math.imul(B,re)|0,i=i+Math.imul(B,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(T,ae)|0,i=i+Math.imul(T,oe)|0,i=i+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(M,fe)|0,i=i+Math.imul(M,ue)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ue)|0,n=n+Math.imul(k,he)|0,i=i+Math.imul(k,le)|0,i=i+Math.imul(x,he)|0,a=a+Math.imul(x,le)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,J),i=Math.imul(L,ee),i=i+Math.imul(H,J)|0,a=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(j,re)|0,a=a+Math.imul(j,ne)|0,n=n+Math.imul(B,ae)|0,i=i+Math.imul(B,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(T,fe)|0,i=i+Math.imul(T,ue)|0,i=i+Math.imul(R,fe)|0,a=a+Math.imul(R,ue)|0,n=n+Math.imul(M,he)|0,i=i+Math.imul(M,le)|0,i=i+Math.imul(E,he)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(k,pe)|0,i=i+Math.imul(k,be)|0,i=i+Math.imul(x,pe)|0,a=a+Math.imul(x,be)|0;var Te=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),i=Math.imul(L,ne),i=i+Math.imul(H,re)|0,a=Math.imul(H,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(j,ae)|0,a=a+Math.imul(j,oe)|0,n=n+Math.imul(B,fe)|0,i=i+Math.imul(B,ue)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(T,he)|0,i=i+Math.imul(T,le)|0,i=i+Math.imul(R,he)|0,a=a+Math.imul(R,le)|0,n=n+Math.imul(M,pe)|0,i=i+Math.imul(M,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Re=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ae),i=Math.imul(L,oe),i=i+Math.imul(H,ae)|0,a=Math.imul(H,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ue)|0,i=i+Math.imul(j,fe)|0,a=a+Math.imul(j,ue)|0,n=n+Math.imul(B,he)|0,i=i+Math.imul(B,le)|0,i=i+Math.imul(C,he)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(T,pe)|0,i=i+Math.imul(T,be)|0,i=i+Math.imul(R,pe)|0,a=a+Math.imul(R,be)|0;var Pe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,fe),i=Math.imul(L,ue),i=i+Math.imul(H,fe)|0,a=Math.imul(H,ue),n=n+Math.imul(N,he)|0,i=i+Math.imul(N,le)|0,i=i+Math.imul(j,he)|0,a=a+Math.imul(j,le)|0,n=n+Math.imul(B,pe)|0,i=i+Math.imul(B,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Be=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,he),i=Math.imul(L,le),i=i+Math.imul(H,he)|0,a=Math.imul(H,le),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(j,pe)|0,a=a+Math.imul(j,be)|0;var Ce=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,pe),i=Math.imul(L,be),i=i+Math.imul(H,pe)|0,a=Math.imul(H,be);var Oe=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=Se,f[7]=ke,f[8]=xe,f[9]=Ae,f[10]=Me,f[11]=Ee,f[12]=Ie,f[13]=Te,f[14]=Re,f[15]=Pe,f[16]=Be,f[17]=Ce,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};Math.imul||(x=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?u(this,e,t):r<1024?c(this,e,t):h(this,e,t)},l.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},l.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var l;return l=0===t.cmpn(1)?i:o,l.cmpn(0)<0&&l.iadd(e),l},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},d.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},d.prototype.split=function(e,t){e.iushrn(this.n,0,t)},d.prototype.imulK=function(e){return e.imul(this.k)},i(p,d),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(A[e])return A[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return A[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var b=d,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(57)(e))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||o.nextTick(a,this)}function a(e){e.end()}var o=r(25),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=n;var f=r(22);f.inherits=r(1);var u=r(51),c=r(33);f.inherits(n,u);for(var h=s(c.prototype),l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e,t,r){for(var n=[],a=0,o=0;o>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=o<<16|s<<8|f,c=0;c<4&&a+.75*c>>6*(3-c)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,u=s.Hasher,c=o.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=c.MD5=u.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var u=this._hash.words,c=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],S=e[t+11],k=e[t+12],x=e[t+13],A=e[t+14],M=e[t+15],E=u[0],I=u[1],T=u[2],R=u[3];E=r(E,I,T,R,c,7,h[0]),R=r(R,E,I,T,l,12,h[1]),T=r(T,R,E,I,d,17,h[2]),I=r(I,T,R,E,p,22,h[3]),E=r(E,I,T,R,b,7,h[4]),R=r(R,E,I,T,v,12,h[5]),T=r(T,R,E,I,m,17,h[6]),I=r(I,T,R,E,g,22,h[7]),E=r(E,I,T,R,y,7,h[8]),R=r(R,E,I,T,w,12,h[9]),T=r(T,R,E,I,_,17,h[10]),I=r(I,T,R,E,S,22,h[11]),E=r(E,I,T,R,k,7,h[12]),R=r(R,E,I,T,x,12,h[13]),T=r(T,R,E,I,A,17,h[14]),I=r(I,T,R,E,M,22,h[15]),E=n(E,I,T,R,l,5,h[16]),R=n(R,E,I,T,m,9,h[17]),T=n(T,R,E,I,S,14,h[18]),I=n(I,T,R,E,c,20,h[19]),E=n(E,I,T,R,v,5,h[20]),R=n(R,E,I,T,_,9,h[21]),T=n(T,R,E,I,M,14,h[22]),I=n(I,T,R,E,b,20,h[23]),E=n(E,I,T,R,w,5,h[24]),R=n(R,E,I,T,A,9,h[25]),T=n(T,R,E,I,p,14,h[26]),I=n(I,T,R,E,y,20,h[27]),E=n(E,I,T,R,x,5,h[28]),R=n(R,E,I,T,d,9,h[29]),T=n(T,R,E,I,g,14,h[30]),I=n(I,T,R,E,k,20,h[31]),E=i(E,I,T,R,v,4,h[32]),R=i(R,E,I,T,y,11,h[33]),T=i(T,R,E,I,S,16,h[34]),I=i(I,T,R,E,A,23,h[35]),E=i(E,I,T,R,l,4,h[36]),R=i(R,E,I,T,b,11,h[37]),T=i(T,R,E,I,g,16,h[38]),I=i(I,T,R,E,_,23,h[39]),E=i(E,I,T,R,x,4,h[40]),R=i(R,E,I,T,c,11,h[41]),T=i(T,R,E,I,p,16,h[42]),I=i(I,T,R,E,m,23,h[43]),E=i(E,I,T,R,w,4,h[44]),R=i(R,E,I,T,k,11,h[45]),T=i(T,R,E,I,M,16,h[46]),I=i(I,T,R,E,d,23,h[47]),E=a(E,I,T,R,c,6,h[48]),R=a(R,E,I,T,g,10,h[49]),T=a(T,R,E,I,A,15,h[50]),I=a(I,T,R,E,v,21,h[51]),E=a(E,I,T,R,k,6,h[52]),R=a(R,E,I,T,p,10,h[53]),T=a(T,R,E,I,_,15,h[54]),I=a(I,T,R,E,l,21,h[55]),E=a(E,I,T,R,y,6,h[56]),R=a(R,E,I,T,M,10,h[57]),T=a(T,R,E,I,m,15,h[58]),I=a(I,T,R,E,x,21,h[59]),E=a(E,I,T,R,b,6,h[60]),R=a(R,E,I,T,S,10,h[61]),T=a(T,R,E,I,d,15,h[62]),I=a(I,T,R,E,w,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+I|0,u[2]=u[2]+T|0,u[3]=u[3]+R|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 a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,u=0;u<4;u++){var c=f[u];f[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=u._createHelper(l),o.HmacMD5=u._createHmacHelper(l)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TxAttrUsage=t.Transaction=void 0;var a=r(68);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(28);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(44);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=r(172),u=i(f),c=n(a),h=n(o),l=n(s),d=r(71),p=i(d),b={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){e.exports=r(177)},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomArray=t.generatePrivateKey=t.generateSignature=t.getScriptHashFromAddress=t.getAddressFromScriptHash=t.getScriptHashFromPublicKey=t.getVerificationScriptFromPublicKey=t.getPublicKeyFromPrivateKey=t.getWIFFromPrivateKey=t.getPrivateKeyFromWIF=t.getPublicKeyUnencoded=t.getPublicKeyEncoded=void 0;var i=r(85),a=n(i),o=r(8),s=r(36),f=n(s),u=r(2),c=r(4),h=r(159),l=n(h),d=new o.ec("p256"),p=t.getPublicKeyEncoded=function(e){var t=(0,u.hexstring2ab)(e);return t[64]%2==1?"03"+(0,u.ab2hexstring)(t.slice(1,33)):"02"+(0,u.ab2hexstring)(t.slice(1,33))},b=(t.getPublicKeyUnencoded=function(e){return d.keyFromPublic(e,"hex").getPublic().encode("hex")},t.getPrivateKeyFromWIF=function(e){return(0,u.ab2hexstring)(a.default.decode(e,128).privateKey)},t.getWIFFromPrivateKey=function(t){return a.default.encode(128,e.from(t,"hex"),!0)},t.getPublicKeyFromPrivateKey=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,u.reverseHex)((0,u.hash160)(t))},t.getAddressFromScriptHash=function(t){t=(0,u.reverseHex)(t);var r=(0,u.hash256)(c.ADDR_VERSION+t).substr(0,8);return f.default.encode(e.from(c.ADDR_VERSION+t+r,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,u.ab2hexstring)(f.default.decode(e));return(0,u.reverseHex)(t.substr(2,40))},t.generateSignature=function(t,r){var n=(0,u.sha256)(t),i=e.from(n,"hex"),a=new o.ec("p256"),s=a.sign(i,r,null);return e.concat([s.r.toArrayLike(e,"be",32),s.s.toArrayLike(e,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,u.ab2hexstring)((0,l.default)(32))},t.generateRandomArray=function(e){return(0,l.default)(e)}}).call(t,r(7).Buffer)},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,f,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,f=0;f0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){t=e.exports=r(51),t.Stream=t,t.Readable=t,t.Writable=r(33),t.Duplex=r(15),t.Transform=r(54),t.PassThrough=r(96)},function(e,t,r){"use strict";(function(t,n,i){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){E(t,e)}}function o(e){return O.from(e)}function s(e){return O.isBuffer(e)||e instanceof N}function f(){}function u(e,t){T=T||r(15),e=e||{};var n=t instanceof T;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,o=e.writableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){g(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function c(e){if(T=T||r(15),!(z.call(c,this)||this instanceof T))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),C.call(this)}function h(e,t){var r=new Error("write after end");e.emit("error",r),I.nextTick(t,r)}function l(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),I.nextTick(n,a),i=!1),i}function d(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=O.from(t,r)),t}function p(e,t,r,n,i,a){if(!r){var o=d(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1?n:I.nextTick;c.WritableState=u;var P=r(22);P.inherits=r(1);var B={deprecate:r(95)},C=r(52),O=r(5).Buffer,N=i.Uint8Array||function(){},j=r(53);P.inherits(c,C),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:B.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var z;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||this===c&&(e&&e._writableState instanceof u)}})):z=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&s(e);return a&&!O.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=f),n.ended?h(this,r):(a||l(this,n,e,r))&&(n.pendingcb++,i=p(this,n,a,e,t,r)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||M(this,n,r)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=j.destroy,c.prototype._undestroy=j.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(10),r(34).setImmediate,r(14))},function(e,t,r){(function(e){function n(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new n(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(94),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(t,r(14))},function(e,t,r){"use strict";function n(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=n(e);if("string"!=typeof t&&(g.isEncoding===y||!y(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=l,this.end=d,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=p,this.end=b,t=3;break;default:return this.write=v,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function f(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}function u(e){var t=this.lastTotal-this.lastNeed,r=f(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function p(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function b(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var g=r(5).Buffer,y=g.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>>31}var h=(n<<5|n>>>27)+f+o[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,u=0;u=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),f(n,e,n.depth)}function a(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function o(e,t){return e}function s(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function f(e,r,n){if(e.customInspect&&r&&M(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=f(e,i,n)),i}var a=u(e,r);if(a)return a;var o=Object.keys(r),b=s(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),A(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(r);if(0===o.length){if(M(r)){var v=r.name?": "+r.name:"";return e.stylize("[Function"+v+"]","special")}if(S(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return c(r)}var m="",g=!1,w=["{","}"];if(p(r)&&(g=!0,w=["[","]"]),M(r)){m=" [Function"+(r.name?": "+r.name:"")+"]"}if(S(r)&&(m=" "+RegExp.prototype.toString.call(r)),x(r)&&(m=" "+Date.prototype.toUTCString.call(r)),A(r)&&(m=" "+c(r)),0===o.length&&(!g||0==r.length))return w[0]+m+w[1];if(n<0)return S(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var _;return _=g?h(e,r,n,b,o):o.map(function(t){return l(e,r,n,b,t,g)}),e.seen.pop(),d(_,m,w)}function u(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i){for(var a=[],o=0,s=t.length;o-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function p(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return null==e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function S(e){return k(e)&&"[object RegExp]"===I(e)}function k(e){return"object"==typeof e&&null!==e}function x(e){return k(e)&&"[object Date]"===I(e)}function A(e){return k(e)&&("[object Error]"===I(e)||e instanceof Error)}function M(e){return"function"==typeof e}function E(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function I(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}function R(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var B=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return f.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,c.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,c.decrypt)(this.encrypted,e,t),this._updateContractScript(),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:Symbol.toStringTag,get:function(){return"Account"}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=f.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=f.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=f.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=f.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=f.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=f.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClaimItem=t.Coin=t.AssetBalance=void 0;var n=r(2),i=(t.AssetBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{balance:e.balance?new n.Fixed8(e.balance):new n.Fixed8(0),unspent:e.unspent?e.unspent.map(function(e){return i(e)}):[],spent:e.spent?e.spent.map(function(e){return i(e)}):[],unconfirmed:e.unconfirmed?e.unconfirmed.map(function(e){return i(e)}):[]}},t.Coin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{index:e.index||0,txid:e.txid||"",value:e.value?new n.Fixed8(e.value):new n.Fixed8(0)}});t.ClaimItem=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{claim:e.claim?new n.Fixed8(e.claim):new n.Fixed8(0),txid:e.txid||"",index:e.index||0,value:e.value||0,start:e.start?new n.Fixed8(e.start):null,end:e.end?new n.Fixed8(e.end):null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(2),i=r(28),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},l=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},d=function(e){return{script:e.script||"",gas:e.gas||0}};t.serializeExclusive={2:o,128:u,209:l},t.deserializeExclusive={2:a,128:f,209:h},t.getExclusive={2:s,128:c,209:d}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(173);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(70),o=n(a),s=r(69),f=n(s),u=r(174),c=n(u),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s}).call(t,r(10))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getAPIEndpoint=t.name=void 0;var i=r(29),a=n(i),o=r(11),s=r(21),f=r(24),u=r(4),c=r(2),h=r(6),l=n(h),d=(0,l.default)("api"),p=(t.name="neonDB",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}}),b=t.getBalance=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/balance/"+t).then(function(r){var n=new o.Balance({net:e,address:r.data.address});return Object.keys(r.data).map(function(e){"net"!==e&&"address"!==e&&n.addAsset(e,r.data[e])}),d.info("Retrieved Balance for "+t+" from neonDB "+e),n})},v=t.getClaims=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){var n=r.data;return n.claims=n.claims.map(function(e){return{claim:new c.Fixed8(e.claim).div(1e8),index:e.index,txid:e.txid,start:new c.Fixed8(e.start),end:new c.Fixed8(e.end),value:e.value}}),d.info("Retrieved Claims for "+t+" from neonDB "+e),new o.Claims(n)})},m=(t.getMaxClaimAmount=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){return d.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neonDB "+e),new c.Fixed8(r.data.total_claim+r.data.total_unspent_claim).div(1e8)})},t.getRPCEndpoint=function(e){var t=p(e);return a.default.get(t+"/v2/network/nodes").then(function(e){var t=e.data.nodes.filter(function(e){return e.status}),r=0,n=[],i=!0,a=!1,o=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var u=s.value;u.block_height>r?(r=u.block_height,n=[u]):u.block_height===r&&n.push(u)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})});t.getTransactionHistory=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/history/"+t).then(function(r){return d.info("Retrieved History for "+t+" from neonDB "+e),r.data.history})},t.getWalletDBHeight=function(e){var t=p(e);return a.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){d.warn("doClaimAllGas will be deprecated in favor of claimGas");var n=new o.Account(t),i=m(e),a=v(e,n.address),u=void 0,c=void 0;return Promise.all([i,a]).then(function(e){c=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=s.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return u=e,f.Query.sendRawTransaction(u).execute(c)}).then(function(e){return!0===e.result?e.txid=u:d.error("Transaction failed: "+u.serialize()),e})},t.doMintTokens=function(e,t,r,n,i,a){d.warn("doMintTokens will be deprecated in favor of doInvoke");var h=new o.Account(r),l=[{assetId:u.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t,args:[]},v=m(e),g=b(e,h.address),y=void 0,w=void 0;return Promise.all([v,g]).then(function(e){w=e[0];var r=e[1],n=[{data:(0,c.reverseHex)(t),usage:s.TxAttrUsage.Script}],o=s.Transaction.createInvocationTx(r,l,p,i,{attributes:n});return a?a(o,h.publicKey):o.sign(h.privateKey)}).then(function(e){return y=e,f.Query.getContractState(t).execute(w)}).then(function(e){var t={invocationScript:"0000",verificationScript:e.result.script};return y.scripts.unshift(t),f.Query.sendRawTransaction(y).execute(w)}).then(function(e){return!0===e.result?e.txid=y.hash:d.error("Transaction failed: "+y.serialize()),e})},t.doSendAsset=function(e,t,r,n,i){d.warn("doSendAsset will be deprecated in favor of sendAsset");var a=new o.Account(r),c=new o.Account(t),h=m(e),l=b(e,a.address),p=Object.keys(n).map(function(e){return{assetId:u.ASSET_ID[e],value:n[e],scriptHash:c.scriptHash}}),v=void 0,g=void 0;return Promise.all([h,l]).then(function(e){g=e[0];var t=e[1],r=s.Transaction.createContractTx(t,p);return i?i(r,a.publicKey):r.sign(a.privateKey)}).then(function(e){return v=e,f.Query.sendRawTransaction(v).execute(g)}).then(function(e){return!0===e.result?e.txid=v.hash:d.error("Transaction failed: "+v.serialize()),e})}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";function n(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}var i=r(86),a=r(107);e.exports=a(n)},function(e,t,r){function n(){i.call(this)}e.exports=n;var i=r(31).EventEmitter;r(1)(n,i),n.Readable=r(32),n.Writable=r(97),n.Duplex=r(98),n.Transform=r(99),n.PassThrough=r(100),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function n(){u.readable&&u.resume&&u.resume()}function a(){c||(c=!0,e.end())}function o(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(f(),0===i.listenerCount(this,"error"))throw e}function f(){u.removeListener("data",r),e.removeListener("drain",n),u.removeListener("end",a),u.removeListener("close",o),u.removeListener("error",s),e.removeListener("error",s),u.removeListener("end",f),u.removeListener("close",f),e.removeListener("close",f)}var u=this;u.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(u.on("end",a),u.on("close",o));var c=!1;return u.on("error",s),e.on("error",s),u.on("end",f),u.on("close",f),e.on("close",f),e.emit("pipe",u),e}},function(e,t,r){"use strict";(function(t,n){function i(e){return z.from(e)}function a(e){return z.isBuffer(e)||e instanceof L}function o(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?O(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function s(e,t){C=C||r(15),e=e||{};var n=t instanceof C;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new q,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(D||(D=r(35).StringDecoder),this.decoder=new D(e.encoding),this.encoding=e.encoding)}function f(e){if(C=C||r(15),!(this instanceof f))return new f(e);this._readableState=new s(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),j.call(this)}function u(e,t,r,n,a){var o=e._readableState;if(null===t)o.reading=!1,b(e,o);else{var s;a||(s=h(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===z.prototype||(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?c(e,o,t,!1):g(e,o)):c(e,o,t,!1))):n||(o.reading=!1)}return l(o)}function c(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&v(e)),g(e,t)}function h(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=d(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(U("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?B.nextTick(m,e):m(e))}function m(e){U("emit readable"),e.emit("readable"),x(e)}function g(e,t){t.readingMore||(t.readingMore=!0,B.nextTick(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=M(e,t.buffer,t.decoder),r}function M(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}function I(e,t){var r=z.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,B.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return U("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&T(this),null;var n=t.needReadable;U("need readable",n),(0===t.length||t.length-e0?A(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},f.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(e,t){function r(e,t){U("onunpipe"),e===l&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){U("onend"),e.end()}function a(){U("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",f),e.removeListener("unpipe",r),l.removeListener("end",i),l.removeListener("end",h),l.removeListener("data",s),m=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){U("ondata"),g=!1,!1!==e.write(t)||g||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==P(d.pipes,e))&&!m&&(U("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,g=!0),l.pause())}function f(t){U("onerror",t),h(),e.removeListener("error",f),0===N(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),h()}function c(){U("onfinish"),e.removeListener("close",u),h()}function h(){U("unpipe"),l.unpipe(e)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,b=p?i:h;d.endEmitted?B.nextTick(b):l.once("end",b),e.on("unpipe",r);var v=w(l);e.on("drain",v);var m=!1,g=!1;return l.on("data",s),o(e,"error",f),e.once("close",u),e.once("finish",c),e.emit("pipe",l),d.flowing||(U("pipe resume"),l.resume()),e},f.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=r(1),h=r(18),l=r(5).Buffer,d=[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],p=new Array(64);c(n,h),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,c=0|this._c,h=0|this._d,l=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=u(t[m-2])+t[m-7]+f(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var y=v+s(l)+i(l,p,b)+d[g]+t[g]|0,w=o(r)+a(r,n,c)|0;v=b,b=p,p=l,l=h+y|0,h=c,c=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=c+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=l.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=m,p.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function l(e,t){return e>>>0>>0?1:0}var d=r(1),p=r(18),b=r(5).Buffer,v=[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],m=new Array(160);d(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,d=0|this._ch,p=0|this._dh,b=0|this._eh,m=0|this._fh,g=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,k=0|this._dl,x=0|this._el,A=0|this._fl,M=0|this._gl,E=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var T=t[I-30],R=t[I-30+1],P=f(T,R),B=u(R,T);T=t[I-4],R=t[I-4+1];var C=c(T,R),O=h(R,T),N=t[I-14],j=t[I-14+1],z=t[I-32],L=t[I-32+1],H=B+j|0,F=P+N+l(H,B)|0;H=H+O|0,F=F+C+l(H,O)|0,H=H+L|0,F=F+z+l(H,L)|0,t[I]=F,t[I+1]=H}for(var U=0;U<160;U+=2){F=t[U],H=t[U+1];var D=a(r,n,d),q=a(w,_,S),K=o(r,w),Y=o(w,r),V=s(b,x),W=s(x,b),X=v[U],Z=v[U+1],G=i(b,m,g),Q=i(x,A,M),$=E+W|0,J=y+V+l($,E)|0;$=$+Q|0,J=J+G+l($,Q)|0,$=$+Z|0,J=J+X+l($,Z)|0,$=$+H|0,J=J+F+l($,H)|0;var ee=Y+q|0,te=K+D+l(ee,Y)|0;y=g,E=M,g=m,M=A,m=b,A=x,x=k+$|0,b=p+J+l(x,k)|0,p=d,k=S,d=n,S=_,n=r,_=w,w=$+ee|0,r=J+te+l(w,$)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+x|0,this._fl=this._fl+A|0,this._gl=this._gl+M|0,this._hl=this._hl+E|0,this._ah=this._ah+r+l(this._al,w)|0,this._bh=this._bh+n+l(this._bl,_)|0,this._ch=this._ch+d+l(this._cl,S)|0,this._dh=this._dh+p+l(this._dl,k)|0,this._eh=this._eh+b+l(this._el,x)|0,this._fh=this._fh+m+l(this._fl,A)|0,this._gh=this._gh+g+l(this._gl,M)|0,this._hh=this._hh+y+l(this._hl,E)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=b.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function c(e){return l(e,17)^l(e,19)^e>>>10}var h=r(12),l=h.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=u,t.g1_256=c},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(12),a=r(23),o=r(59),s=r(16),f=i.sum32,u=i.sum32_4,c=i.sum32_5,h=o.ch32,l=o.maj32,d=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[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];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=u[d-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[d]=b+u[d-7]+m+u[d-16]}var g=s&c^~s&h,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=l+_+g+f[d]+u[d],k=w+y;l=h,h=c,c=s,s=o+S|0,o=a,a=i,i=n,n=S+k|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|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 e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=t()}();var h=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],h=r[6],l=r[7],d=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,S=s.low,k=f.high,x=f.low,A=h.high,M=h.low,E=l.high,I=l.low,T=d,R=p,P=b,B=v,C=m,O=g,N=y,j=w,z=_,L=S,H=k,F=x,U=A,D=M,q=E,K=I,Y=0;Y<80;Y++){var V=c[Y];if(Y<16)var W=V.high=0|e[t+2*Y],X=V.low=0|e[t+2*Y+1];else{var Z=c[Y-15],G=Z.high,Q=Z.low,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=c[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=c[Y-7],oe=ae.high,se=ae.low,fe=c[Y-16],ue=fe.high,ce=fe.low,X=J+se,W=$+oe+(X>>>0>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ce,W=W+ue+(X>>>0>>0?1:0);V.high=W,V.low=X}var he=z&H^~z&U,le=L&F^~L&D,de=T&P^T&C^P&C,pe=R&B^R&O^B&O,be=(T>>>28|R<<4)^(T<<30|R>>>2)^(T<<25|R>>>7),ve=(R>>>28|T<<4)^(R<<30|T>>>2)^(R<<25|T>>>7),me=(z>>>14|L<<18)^(z>>>18|L<<14)^(z<<23|L>>>9),ge=(L>>>14|z<<18)^(L>>>18|z<<14)^(L<<23|z>>>9),ye=u[Y],we=ye.high,_e=ye.low,Se=K+ge,ke=q+me+(Se>>>0>>0?1:0),Se=Se+le,ke=ke+he+(Se>>>0>>0?1:0),Se=Se+_e,ke=ke+we+(Se>>>0<_e>>>0?1:0),Se=Se+X,ke=ke+W+(Se>>>0>>0?1:0),xe=ve+pe,Ae=be+de+(xe>>>0>>0?1:0);q=U,K=D,U=H,D=F,H=z,F=L,L=j+Se|0,z=N+ke+(L>>>0>>0?1:0)|0,N=C,j=O,C=P,O=B,P=T,B=R,R=Se+xe|0,T=ke+Ae+(R>>>0>>0?1:0)|0}p=n.low=p+R,n.high=d+T+(p>>>0>>0?1:0),v=i.low=v+B,i.high=b+P+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+C+(g>>>0>>0?1:0),w=o.low=w+j,o.high=y+N+(w>>>0>>0?1:0),S=s.low=S+L,s.high=_+z+(S>>>0>>0?1:0),x=f.low=x+F,f.high=k+H+(x>>>0>>0?1:0),M=h.low=M+D,h.high=A+U+(M>>>0>>0?1:0),I=l.low=I+K,l.high=E+q+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(h),r.HmacSHA512=i._createHmacHelper(h)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(36),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(2),o=r(30);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptAsync=t.decrypt=t.encryptAsync=t.encrypt=void 0;var i=r(49),a=n(i),o=r(62),s=r(161),f=n(s),u=r(168),c=n(u),h=r(42),l=n(h),d=r(2),p=r(4),b=r(6),v=n(b),m=(0,v.default)("wallet");m.warn("ScryptParams will be changing to use n,r,p in place of cost, blockSize, parallel. New standard will be preferred. DEFAULT_SCRYPT will use new standard upon major version bump.");var g=(t.encrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;n=g(n);var i={cost:n.n,blockSize:n.r,parallel:n.p},s=new l.default(t),u=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(s.address))).toString().slice(0,8),c=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(u,"hex"),i).toString("hex"),h=c.slice(0,64),b=c.slice(64),v=(0,d.hexXor)(s.privateKey,h),y=o.AES.encrypt(o.enc.Hex.parse(v),o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),w=p.NEP_HEADER+p.NEP_FLAG+u+y.ciphertext.toString(),_=a.default.encode(e.from(w,"hex"));return m.info("Successfully encrypted key to "+_),_},t.encryptAsync=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(i,s){n=g(n);var f=n,u=f.n,h=f.r,b=f.p,v=new l.default(t),y=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(v.address))).toString().slice(0,8);(0,c.default)(e.from(r.normalize("NFC"),"utf8"),e.from(y,"hex"),u,h,b,64,function(t,r,n){if(null!=t)s(t);else if(n){var f=e.from(n).toString("hex"),u=f.slice(0,64),c=f.slice(64),h=(0,d.hexXor)(v.privateKey,u),l=o.AES.encrypt(o.enc.Hex.parse(h),o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),b=p.NEP_HEADER+p.NEP_FLAG+y+l.ciphertext.toString(),g=a.default.encode(e.from(b,"hex"));m.info("Successfully encrypted key to "+g),i(g)}})})},t.decrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;n=g(n);var i={cost:n.n,blockSize:n.r,parallel:n.p},s=(0,d.ab2hexstring)(a.default.decode(t)),u=s.substr(6,8),c=s.substr(-64),h=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(u,"hex"),i).toString("hex"),b=h.slice(0,64),v=h.slice(64),y={ciphertext:o.enc.Hex.parse(c),salt:""},w=o.AES.decrypt(y,o.enc.Hex.parse(v),{mode:o.mode.ECB,padding:o.pad.NoPadding}),_=(0,d.hexXor)(w.toString(),b),S=new l.default(_);if(u!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(S.address))).toString().slice(0,8))throw new Error("Wrong Password!");return m.info("Successfully decrypted "+t),S.WIF},t.decryptAsync=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(i,s){n=g(n);var f=n,u=f.n,h=f.r,p=f.p,b=(0,d.ab2hexstring)(a.default.decode(t)),v=b.substr(6,8),y=b.substr(-64);(0,c.default)(e.from(r.normalize("NFC"),"utf8"),e.from(v,"hex"),u,h,p,64,function(r,n,a){if(null!=r)s(r);else if(a){var f=e.from(a).toString("hex"),u=f.slice(0,64),c=f.slice(64),h={ciphertext:o.enc.Hex.parse(y),salt:""},p=o.AES.decrypt(h,o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),b=(0,d.hexXor)(p.toString(),u),g=new l.default(b),w=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8);if(v!==w)throw new Error("Wrong Password!");m.info("Successfully decrypted "+t),i(g.WIF)}})})},function(e){var t=Object.assign({},p.DEFAULT_SCRYPT,e);return{n:t.n||t.cost,r:t.r||t.blockSize,p:t.p||t.parallel}})}).call(t,r(7).Buffer)},function(e,t,r){(function(t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?t("","utf8"):e instanceof t?e:"string"==typeof e?new t(e,"utf8"):new t(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:u(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function u(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r}).call(t,r(7).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(2),i=r(11),a=r(44),o=r(4),s=r(28),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),u=r(6),c=function(e){return e&&e.__esModule?e:{default:e}}(u),h=(0,c.default)("tx"),l=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var i=t.reduce(function(e,t){return e[t.assetId]?e[t.assetId]=e[t.assetId].add(t.value):e[t.assetId]=t.value,e},{});return r=new n.Fixed8(r),r.gt(0)&&(i[o.ASSET_ID.GAS]?i[o.ASSET_ID.GAS]=i[o.ASSET_ID.GAS].add(r):i[o.ASSET_ID.GAS]=r),Object.keys(i).map(function(t){var r=i[t],n=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(n))throw new Error("This balance does not contain any "+n+"!");var a=e.assets[n];if(a.balance.lt(r))throw new Error("Insufficient "+o.ASSETS[t]+"! Need "+r.toString()+" but only found "+a.balance.toString());return l(a,r,t,e.address)}).reduce(function(e,t){return{inputs:e.inputs.concat(t.inputs),change:e.change.concat(t.change)}},{inputs:[],change:[]})},function(e,t,r,a){e.unspent.sort(function(e,t){return e.value.sub(t.value)});for(var s=0,f=new n.Fixed8(0);f.lt(t);){if((s+=1)>e.unspent.length)throw new Error("Insufficient "+o.ASSETS[r]+"! Reached end of unspent coins! "+e.unspent.length);f=f.add(e.unspent[s-1].value)}var u=[];return f.gt(t)&&u.push({assetId:r,value:f.sub(t),scriptHash:(0,i.getScriptHashFromAddress)(a)}),{inputs:e.unspent.slice(0,s).map(function(e){return{prevHash:e.txid,prevIndex:e.index}}),change:u}}),d=t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var u,c=e.attributes[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;r+=f.serializeTransactionAttribute(h)}}catch(e){o=!0,s=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var l=!0,d=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(l=(b=v.next()).done);l=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){d=!0,p=e}finally{try{!l&&v.return&&v.return()}finally{if(d)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,S=e.outputs[Symbol.iterator]();!(g=(_=S.next()).done);g=!0){var k=_.value;r+=f.serializeTransactionOutput(k)}}catch(e){y=!0,w=e}finally{try{!g&&S.return&&S.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var x=!0,A=!1,M=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(x=(E=I.next()).done);x=!0){var T=E.value;r+=f.serializeWitness(T)}}catch(e){A=!0,M=e}finally{try{!x&&I.return&&I.return()}finally{if(A)throw M}}}return r};t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]&&arguments[1];if((0,f.ensureHex)(e),40!==e.length)throw new Error("ScriptHash should be 20 bytes long!");return this.emit(t?c.default.TAILCALL:c.default.APPCALL,(0,f.reverseHex)(e))}},{key:"_emitArray",value:function(e){for(var t=e.length-1;t>=0;t--)this.emitPush(e[t]);return this.emitPush(e.length).emit(c.default.PACK)}},{key:"_emitString",value:function(e){(0,f.ensureHex)(e);var t=e.length/2;return t<=c.default.PUSHBYTES75?(this.str+=(0,f.num2hexstring)(t),this.str+=e):t<256?(this.emit(c.default.PUSHDATA1),this.str+=(0,f.num2hexstring)(t),this.str+=e):t<65536?(this.emit(c.default.PUSHDATA2),this.str+=(0,f.num2hexstring)(t,2),this.str+=e):(this.emit(c.default.PUSHDATA4),this.str+=(0,f.num2hexstring)(t,4),this.str+=e),this}},{key:"_emitNum",value:function(e){if(-1===e)return this.emit(c.default.PUSHM1);if(0===e)return this.emit(c.default.PUSH0);if(e>0&&e<=16)return this.emit(c.default.PUSH1-1+e);var t=(0,f.int2hex)(e);return this.emitPush((0,f.reverseHex)("0".repeat(16-t.length)+t))}},{key:"_emitParam",value:function(e){if(!e.type)throw new Error("No type available!");if(!l(e.value))throw new Error("Invalid value provided!");switch(e.type){case"String":return this._emitString((0,f.str2hexstring)(e.value));case"Boolean":return this.emit(e.value?c.default.PUSHT:c.default.PUSHF);case"Integer":return this._emitNum(e.value);case"ByteArray":return this._emitString(e.value);case"Array":return this._emitArray(e.value);case"Hash160":return this._emitString((0,f.reverseHex)(e.value))}}},{key:"emit",value:function(e,t){return this.str+=(0,f.num2hexstring)(e),t&&(this.str+=t),this}},{key:"emitAppCall",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.emitPush(r),t){for(var i="",a=0;a1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBlockHash",value:function(t){return new e({method:"getblockhash",params:[t]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;a=0&&e<=1&&(h=e)},t.setSwitchFreeze=function(e){l=!!e,c.info("core/setSwitchFreeze API switch is frozen: "+l)},function(){!l&&h>0&&(h-=.2,c.info("core API Switch increasing weight towards neoscan"))}),p=function(){!l&&h<1&&(h+=.2,c.info("core API Switch increasing weight towards neonDB"))};t.loadBalance=function(e,t){return Math.random()>h?e(t,s).then(function(e){return d(),e}).catch(function(){return p(),e(t,a)}):e(t,a).then(function(e){return p(),e}).catch(function(){return d(),e(t,s)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHistory=t.getWalletDBHeight=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getRPCEndpoint=t.getAPIEndpoint=t.name=void 0;var i=r(29),a=n(i),o=r(11),s=r(4),f=r(2),u=r(6),c=n(u),h=(0,c.default)("api"),l=(t.name="neoscan",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"https://api.neoscan.io/api/main_net";case"TestNet":return"https://neoscan-testnet.io/api/test_net";default:return e}}),d=(t.getRPCEndpoint=function(e){var t=l(e);return a.default.get(t+"/v1/get_all_nodes").then(function(t){var r=t.data,n=0,i=[],a=!0,o=!1,s=void 0;try{for(var f,u=r[Symbol.iterator]();!(a=(f=u.next()).done);a=!0){var c=f.value;c.height>n?(n=c.height,i=[c]):c.height===n&&i.push(c)}}catch(e){o=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(o)throw s}}var l=i[Math.floor(Math.random()*i.length)].url;return h.info("Best node from neoscan "+e+": "+l),l})},t.getBalance=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_balance/"+t).then(function(r){if(r.data.address!==t&&null===r.data.balance)return new o.Balance({address:r.data.address});var n=new o.Balance({address:r.data.address,net:e});return r.data.balance.map(function(e){n.addAsset(e.asset,{balance:e.amount,unspent:d(e.unspent)})}),h.info("Retrieved Balance for "+t+" from neoscan "+e),n})},t.getClaims=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){if(r.address!==t&&null===r.data.claimable)return new o.Claims({address:r.data.address});var n=p(r.data.claimable);return h.info("Retrieved Balance for "+t+" from neoscan "+e),new o.Claims({net:e,address:r.data.address,claims:n})})},t.getMaxClaimAmount=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){return h.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neoscan "+e),new f.Fixed8(r.data.unclaimed||0)})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),p=function(e){return e.map(function(e){return{start:new f.Fixed8(e.start_height),end:new f.Fixed8(e.end_height),index:e.n,claim:new f.Fixed8(e.unclaimed),txid:e.txid,value:e.value}})},b=(t.getWalletDBHeight=function(e){var t=l(e);return a.default.get(t+"/v1/get_height").then(function(e){return parseInt(e.data.height)})},t.getTransactionHistory=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_address_neon/"+t).then(function(r){return h.info("Retrieved History for "+t+" from neoscan "+e),b(r.data.txids)})},function(e){return e.map(function(e){var t=e.txid,r=e.block_height,n=e.balance,i=e.asset_moved,a=!1,o=!1,f=s.ASSETS.GAS,u=s.ASSETS.NEO;return n.forEach(function(e){var t=e.asset,r=e.amount;t===f&&(f=r),t===u&&(u=r)}),s.ASSET_ID.GAS===i&&(a=!0),s.ASSET_ID.NEO===i&&(o=!0),{GAS:f,NEO:u,block_index:r,gas_sent:a,neo_sent:o,txid:t}})})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.logging=t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(81),a=n(i),o=r(24),s=n(o),f=r(4),u=n(f),c=r(45),h=n(c),l=r(21),d=n(l),p=r(11),b=n(p),v=r(2),m=n(v),g=r(6),y=n(g),w=[h.default,d.default,b.default,a.default,s.default],_=w.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:u,u:m});t.default=_,t.api=a,t.rpc=s,t.sc=h,t.tx=d,t.wallet=b,t.u=m,t.CONST=u,t.logging=y},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(82);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(78);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(47),s=n(o),f=r(198),u=n(f),c=r(199),h=n(c),l=r(79),d=n(l),p=n(i);t.default={get:{price:u.getPrice,prices:u.getPrices,balance:s.getBalance,claims:s.getClaims,transactionHistory:s.getTransactionHistory,tokenBalance:h.getTokenBalance,tokenInfo:h.getTokenInfo,token:h.getToken},do:{sendAsset:s.doSendAsset,claimAllGas:s.doClaimAllGas,mintTokens:s.doMintTokens},sendAsset:function(e){return p.sendAsset(e)},claimGas:function(e){return p.claimGas(e)},doInvoke:function(e){return p.doInvoke(e)}},t.neonDB=s,t.cmc=u,t.nep5=h,t.neoscan=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxClaimAmountFrom=t.getWalletDBHeightFrom=t.getTransactionHistoryFrom=t.getRPCEndpointFrom=t.getClaimsFrom=t.getBalanceFrom=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.fillKeys=t.fillBalance=t.fillUrl=t.doInvoke=t.claimGas=t.sendAsset=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(11),a=r(4),o=r(24),s=r(21),f=r(2),u=r(78),c=r(6),h=function(e){return e&&e.__esModule?e:{default:e}}(c),l=(0,h.default)("api"),d=(t.sendAsset=function(e){return d(e).then(b).then(p).then(function(e){return v(e,"contract")}).then(function(e){return _(e)}).then(function(e){return m(e)}).then(function(e){return S(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,tx:e.tx};throw l.error("sendAsset failed with: "+t.message+". Dumping config",r),t})},t.claimGas=function(e){return d(e).then(b).then(function(t){return(0,u.loadBalance)(A,e)}).then(function(e){return v(e,"claim")}).then(function(e){return m(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,claims:e.claims,tx:e.tx};throw l.error("claimGas failed with "+t.message+". Dumping config",r),t})},t.doInvoke=function(e){return d(e).then(b).then(p).then(function(e){return v(e,"invocation")}).then(function(e){return _(e)}).then(function(e){return y(e)}).then(function(e){return m(e)}).then(function(e){return w(e)}).then(function(e){return S(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,script:e.script,gas:e.gas,tx:e.tx};throw l.error("doInvoke failed with "+t.message+". Dumping config",r),t})},t.fillUrl=function(e){return e.url?Promise.resolve(e):(0,u.loadBalance)(M,e).then(function(t){return Object.assign(e,{url:t})})}),p=t.fillBalance=function(e){return e.balance?Promise.resolve(e):(0,u.loadBalance)(x,e)},b=t.fillKeys=function(e){return e.account&&(e.address||(e.address=e.account.address),e.privateKey||e.signingFunction||(e.privateKey=e.account.privateKey),!e.publicKey&&e.signingFunction&&(e.publicKey=e.account.publicKey)),Promise.resolve(e)},v=t.createTx=function(e,t){if(e.tx)return e;"string"==typeof t&&(t=t.toLowerCase());var r=void 0;switch(t){case"claim":case 2:k(e,"claims"),r=s.Transaction.createClaimTx(e.address,e.claims);break;case"contract":case 128:k(e,"balance","intents"),r=s.Transaction.createContractTx(e.balance,e.intents,e.override);break;case"invocation":case 209:k(e,"balance","gas","script"),e.intents||(e.intents=[]),r=s.Transaction.createInvocationTx(e.balance,e.intents,e.script,e.gas,e.override);break;default:return Promise.reject(new Error("Tx Type not found: "+t))}return Promise.resolve(Object.assign(e,{tx:r}))},m=t.signTx=function(e){k(e,"tx");var t=void 0;if(e.signingFunction){var r=new i.Account(e.publicKey);t=e.signingFunction(e.tx,r.publicKey).then(function(e){return"string"==typeof e&&(e=s.Transaction.deserialize(e)),e})}else{if(!e.privateKey)return Promise.reject(new Error("Needs privateKey or signingFunction to sign!"));var n=new i.Account(e.privateKey);if(e.address!==n.address&&!e.sendingFromSmartContract)return Promise.reject(new Error("Private Key and Balance address does not match!"));t=Promise.resolve(e.tx.sign(n.privateKey))}return t.then(function(t){return Object.assign(e,{tx:t})})},g=t.sendTx=function(e){return k(e,"tx","url"),o.Query.sendRawTransaction(e.tx).execute(e.url).then(function(t){if(!0===t.result)t.txid=e.tx.hash,e.balance&&e.balance.applyTx(e.tx,!1);else{var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,claims:e.claims,script:e.script,gas:e.gas,tx:e.tx};l.error("Transaction failed for "+e.address+": "+e.tx.serialize(),r)}return Object.assign(e,{response:t})})},y=(t.makeIntent=function(e,t){var r=new i.Account(t);return Object.keys(e).map(function(t){return(0,s.TransactionOutput)({assetId:a.ASSET_ID[t],value:e[t],scriptHash:r.scriptHash})})},function(e){return e.override||(e.override={}),"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash&&e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(e.script.scriptHash)),Promise.resolve(e)}),w=function(e){return"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash?o.Query.getContractState(e.script.scriptHash).execute(e.url).then(function(t){var r=t.result.parameters,n={invocationScript:"00".repeat(r.length),verificationScript:""},a=new i.Account(e.address);return parseInt(e.script.scriptHash,16)>parseInt(a.scriptHash,16)?e.tx.scripts.push(n):e.tx.scripts.unshift(n),e}):Promise.resolve(e)},_=function(e){if(e.override||(e.override={}),e.sendingFromSmartContract){var t=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(t.scriptHash))}return Promise.resolve(e)},S=function(e){if(e.sendingFromSmartContract){var t=(0,i.getScriptHashFromAddress)(e.address);return o.Query.getContractState(t).execute(e.url).then(function(r){var n=r.result.parameters,a={invocationScript:"00".repeat(n.length),verificationScript:""},o=new i.Account(e.address);return parseInt(t,16)>parseInt(o.scriptHash,16)?e.tx.scripts.push(a):e.tx.scripts.unshift(a),e})}return Promise.resolve(e)},k=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function a(e){var t,r,i,a,o,s=e.length;a=n(e),o=new h(3*s/4-a),r=a>0?s-4:s;var f=0;for(t=0;t>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[f++]=255&i):1===a&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,r){for(var n,i=[],a=t;af?f:o+16383));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),a.push(i),a.join("")}t.byteLength=i,t.toByteArray=a,t.fromByteArray=f;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=l.length;d>1,c=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=l,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=l,c-=8);if(0===a)a=1-u;else{if(a===f)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,f,u=8*a-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),t+=o+h>=1?l/f:l*Math.pow(2,1-h),t*f>=2&&(o++,f/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*f-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*b}},function(e,t,r){(function(t){function n(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}function a(e,t){return n(s.decode(e),t)}function o(e,t,r){return"number"==typeof e?s.encode(i(e,t,r)):s.encode(i(e.version,e.privateKey,e.compressed))}var s=r(49);e.exports={decode:a,decodeRaw:n,encode:o,encodeRaw:i}}).call(t,r(7).Buffer)},function(e,t,r){"use strict";(function(t){function n(e){u.call(this,"digest"),this._hash=e,this.buffers=[]}function i(e){u.call(this,"digest"),this._hash=e}var a=r(1),o=r(87),s=r(89),f=r(101),u=r(106);a(n,u),n.prototype._update=function(e){this.buffers.push(e)},n.prototype._final=function(){var e=t.concat(this.buffers),r=this._hash(e);return this.buffers=null,r},a(i,u),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return e=e.toLowerCase(),"md5"===e?new n(o):new i("rmd160"===e||"ripemd160"===e?new s:f(e))}}).call(t,r(7).Buffer)},function(e,t,r){"use strict";function n(e,t){e[t>>5]|=128<>>9<<4)]=t;for(var r=1732584193,n=-271733879,i=-1732584194,c=271733878,h=0;h>16)+(t>>16)+(r>>16)<<16|65535&r}function c(e,t){return e<>>32-t}var h=r(88);e.exports=function(e){return h(e,n)}},function(e,t,r){"use strict";(function(t){function r(e){if(e.length%n!=0){var r=e.length+(n-e.length%n);e=t.concat([e,i],r)}for(var a=new Array(e.length>>>2),o=0,s=0;o>>32-t}function a(e,t,r,n,a,o,s,f){return i(e+(t^r^n)+o+s|0,f)+a|0}function o(e,t,r,n,a,o,s,f){return i(e+(t&r|~t&n)+o+s|0,f)+a|0}function s(e,t,r,n,a,o,s,f){return i(e+((t|~r)^n)+o+s|0,f)+a|0}function f(e,t,r,n,a,o,s,f){return i(e+(t&n|r&~n)+o+s|0,f)+a|0}function u(e,t,r,n,a,o,s,f){return i(e+(t^(r|~n))+o+s|0,f)+a|0}var c=r(1),h=r(90);c(n,h),n.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,c=this._c,h=this._d,l=this._e;r=a(r,n,c,h,l,e[0],0,11),c=i(c,10),l=a(l,r,n,c,h,e[1],0,14),n=i(n,10),h=a(h,l,r,n,c,e[2],0,15),r=i(r,10),c=a(c,h,l,r,n,e[3],0,12),l=i(l,10),n=a(n,c,h,l,r,e[4],0,5),h=i(h,10),r=a(r,n,c,h,l,e[5],0,8),c=i(c,10),l=a(l,r,n,c,h,e[6],0,7),n=i(n,10),h=a(h,l,r,n,c,e[7],0,9),r=i(r,10),c=a(c,h,l,r,n,e[8],0,11),l=i(l,10),n=a(n,c,h,l,r,e[9],0,13),h=i(h,10),r=a(r,n,c,h,l,e[10],0,14),c=i(c,10),l=a(l,r,n,c,h,e[11],0,15),n=i(n,10),h=a(h,l,r,n,c,e[12],0,6),r=i(r,10),c=a(c,h,l,r,n,e[13],0,7),l=i(l,10),n=a(n,c,h,l,r,e[14],0,9),h=i(h,10),r=a(r,n,c,h,l,e[15],0,8),c=i(c,10),l=o(l,r,n,c,h,e[7],1518500249,7),n=i(n,10),h=o(h,l,r,n,c,e[4],1518500249,6),r=i(r,10),c=o(c,h,l,r,n,e[13],1518500249,8),l=i(l,10),n=o(n,c,h,l,r,e[1],1518500249,13),h=i(h,10),r=o(r,n,c,h,l,e[10],1518500249,11),c=i(c,10),l=o(l,r,n,c,h,e[6],1518500249,9),n=i(n,10),h=o(h,l,r,n,c,e[15],1518500249,7),r=i(r,10),c=o(c,h,l,r,n,e[3],1518500249,15),l=i(l,10),n=o(n,c,h,l,r,e[12],1518500249,7),h=i(h,10),r=o(r,n,c,h,l,e[0],1518500249,12),c=i(c,10),l=o(l,r,n,c,h,e[9],1518500249,15),n=i(n,10),h=o(h,l,r,n,c,e[5],1518500249,9),r=i(r,10),c=o(c,h,l,r,n,e[2],1518500249,11),l=i(l,10),n=o(n,c,h,l,r,e[14],1518500249,7),h=i(h,10),r=o(r,n,c,h,l,e[11],1518500249,13),c=i(c,10),l=o(l,r,n,c,h,e[8],1518500249,12),n=i(n,10),h=s(h,l,r,n,c,e[3],1859775393,11),r=i(r,10),c=s(c,h,l,r,n,e[10],1859775393,13),l=i(l,10),n=s(n,c,h,l,r,e[14],1859775393,6),h=i(h,10),r=s(r,n,c,h,l,e[4],1859775393,7),c=i(c,10),l=s(l,r,n,c,h,e[9],1859775393,14),n=i(n,10),h=s(h,l,r,n,c,e[15],1859775393,9),r=i(r,10),c=s(c,h,l,r,n,e[8],1859775393,13),l=i(l,10),n=s(n,c,h,l,r,e[1],1859775393,15),h=i(h,10),r=s(r,n,c,h,l,e[2],1859775393,14),c=i(c,10),l=s(l,r,n,c,h,e[7],1859775393,8),n=i(n,10),h=s(h,l,r,n,c,e[0],1859775393,13),r=i(r,10),c=s(c,h,l,r,n,e[6],1859775393,6),l=i(l,10),n=s(n,c,h,l,r,e[13],1859775393,5),h=i(h,10),r=s(r,n,c,h,l,e[11],1859775393,12),c=i(c,10),l=s(l,r,n,c,h,e[5],1859775393,7),n=i(n,10),h=s(h,l,r,n,c,e[12],1859775393,5),r=i(r,10),c=f(c,h,l,r,n,e[1],2400959708,11),l=i(l,10),n=f(n,c,h,l,r,e[9],2400959708,12),h=i(h,10),r=f(r,n,c,h,l,e[11],2400959708,14),c=i(c,10),l=f(l,r,n,c,h,e[10],2400959708,15),n=i(n,10),h=f(h,l,r,n,c,e[0],2400959708,14),r=i(r,10),c=f(c,h,l,r,n,e[8],2400959708,15),l=i(l,10),n=f(n,c,h,l,r,e[12],2400959708,9),h=i(h,10),r=f(r,n,c,h,l,e[4],2400959708,8),c=i(c,10),l=f(l,r,n,c,h,e[13],2400959708,9),n=i(n,10),h=f(h,l,r,n,c,e[3],2400959708,14),r=i(r,10),c=f(c,h,l,r,n,e[7],2400959708,5),l=i(l,10),n=f(n,c,h,l,r,e[15],2400959708,6),h=i(h,10),r=f(r,n,c,h,l,e[14],2400959708,8),c=i(c,10),l=f(l,r,n,c,h,e[5],2400959708,6),n=i(n,10),h=f(h,l,r,n,c,e[6],2400959708,5),r=i(r,10),c=f(c,h,l,r,n,e[2],2400959708,12),l=i(l,10),n=u(n,c,h,l,r,e[4],2840853838,9),h=i(h,10),r=u(r,n,c,h,l,e[0],2840853838,15),c=i(c,10),l=u(l,r,n,c,h,e[5],2840853838,5),n=i(n,10),h=u(h,l,r,n,c,e[9],2840853838,11),r=i(r,10),c=u(c,h,l,r,n,e[7],2840853838,6),l=i(l,10),n=u(n,c,h,l,r,e[12],2840853838,8),h=i(h,10),r=u(r,n,c,h,l,e[2],2840853838,13),c=i(c,10),l=u(l,r,n,c,h,e[10],2840853838,12),n=i(n,10),h=u(h,l,r,n,c,e[14],2840853838,5),r=i(r,10),c=u(c,h,l,r,n,e[1],2840853838,12),l=i(l,10),n=u(n,c,h,l,r,e[3],2840853838,13),h=i(h,10),r=u(r,n,c,h,l,e[8],2840853838,14),c=i(c,10),l=u(l,r,n,c,h,e[11],2840853838,11),n=i(n,10),h=u(h,l,r,n,c,e[6],2840853838,8),r=i(r,10),c=u(c,h,l,r,n,e[15],2840853838,5),l=i(l,10),n=u(n,c,h,l,r,e[13],2840853838,6),h=i(h,10);var d=this._a,p=this._b,b=this._c,v=this._d,m=this._e;d=u(d,p,b,v,m,e[5],1352829926,8),b=i(b,10),m=u(m,d,p,b,v,e[14],1352829926,9),p=i(p,10),v=u(v,m,d,p,b,e[7],1352829926,9),d=i(d,10),b=u(b,v,m,d,p,e[0],1352829926,11),m=i(m,10),p=u(p,b,v,m,d,e[9],1352829926,13),v=i(v,10),d=u(d,p,b,v,m,e[2],1352829926,15),b=i(b,10),m=u(m,d,p,b,v,e[11],1352829926,15),p=i(p,10),v=u(v,m,d,p,b,e[4],1352829926,5),d=i(d,10),b=u(b,v,m,d,p,e[13],1352829926,7),m=i(m,10),p=u(p,b,v,m,d,e[6],1352829926,7),v=i(v,10),d=u(d,p,b,v,m,e[15],1352829926,8),b=i(b,10),m=u(m,d,p,b,v,e[8],1352829926,11),p=i(p,10),v=u(v,m,d,p,b,e[1],1352829926,14),d=i(d,10),b=u(b,v,m,d,p,e[10],1352829926,14),m=i(m,10),p=u(p,b,v,m,d,e[3],1352829926,12),v=i(v,10),d=u(d,p,b,v,m,e[12],1352829926,6),b=i(b,10),m=f(m,d,p,b,v,e[6],1548603684,9),p=i(p,10),v=f(v,m,d,p,b,e[11],1548603684,13),d=i(d,10),b=f(b,v,m,d,p,e[3],1548603684,15),m=i(m,10),p=f(p,b,v,m,d,e[7],1548603684,7),v=i(v,10),d=f(d,p,b,v,m,e[0],1548603684,12),b=i(b,10),m=f(m,d,p,b,v,e[13],1548603684,8),p=i(p,10),v=f(v,m,d,p,b,e[5],1548603684,9),d=i(d,10),b=f(b,v,m,d,p,e[10],1548603684,11),m=i(m,10),p=f(p,b,v,m,d,e[14],1548603684,7),v=i(v,10),d=f(d,p,b,v,m,e[15],1548603684,7),b=i(b,10),m=f(m,d,p,b,v,e[8],1548603684,12),p=i(p,10),v=f(v,m,d,p,b,e[12],1548603684,7),d=i(d,10),b=f(b,v,m,d,p,e[4],1548603684,6),m=i(m,10),p=f(p,b,v,m,d,e[9],1548603684,15),v=i(v,10),d=f(d,p,b,v,m,e[1],1548603684,13),b=i(b,10),m=f(m,d,p,b,v,e[2],1548603684,11),p=i(p,10),v=s(v,m,d,p,b,e[15],1836072691,9),d=i(d,10),b=s(b,v,m,d,p,e[5],1836072691,7),m=i(m,10),p=s(p,b,v,m,d,e[1],1836072691,15),v=i(v,10),d=s(d,p,b,v,m,e[3],1836072691,11),b=i(b,10),m=s(m,d,p,b,v,e[7],1836072691,8),p=i(p,10),v=s(v,m,d,p,b,e[14],1836072691,6),d=i(d,10),b=s(b,v,m,d,p,e[6],1836072691,6),m=i(m,10),p=s(p,b,v,m,d,e[9],1836072691,14),v=i(v,10),d=s(d,p,b,v,m,e[11],1836072691,12),b=i(b,10),m=s(m,d,p,b,v,e[8],1836072691,13),p=i(p,10),v=s(v,m,d,p,b,e[12],1836072691,5),d=i(d,10),b=s(b,v,m,d,p,e[2],1836072691,14),m=i(m,10),p=s(p,b,v,m,d,e[10],1836072691,13),v=i(v,10),d=s(d,p,b,v,m,e[0],1836072691,13),b=i(b,10),m=s(m,d,p,b,v,e[4],1836072691,7),p=i(p,10),v=s(v,m,d,p,b,e[13],1836072691,5),d=i(d,10),b=o(b,v,m,d,p,e[8],2053994217,15),m=i(m,10),p=o(p,b,v,m,d,e[6],2053994217,5),v=i(v,10),d=o(d,p,b,v,m,e[4],2053994217,8),b=i(b,10),m=o(m,d,p,b,v,e[1],2053994217,11),p=i(p,10),v=o(v,m,d,p,b,e[3],2053994217,14),d=i(d,10),b=o(b,v,m,d,p,e[11],2053994217,14),m=i(m,10),p=o(p,b,v,m,d,e[15],2053994217,6),v=i(v,10),d=o(d,p,b,v,m,e[0],2053994217,14),b=i(b,10),m=o(m,d,p,b,v,e[5],2053994217,6),p=i(p,10),v=o(v,m,d,p,b,e[12],2053994217,9),d=i(d,10),b=o(b,v,m,d,p,e[2],2053994217,12),m=i(m,10),p=o(p,b,v,m,d,e[13],2053994217,9),v=i(v,10),d=o(d,p,b,v,m,e[9],2053994217,12),b=i(b,10),m=o(m,d,p,b,v,e[7],2053994217,5),p=i(p,10),v=o(v,m,d,p,b,e[10],2053994217,15),d=i(d,10),b=o(b,v,m,d,p,e[14],2053994217,8),m=i(m,10),p=a(p,b,v,m,d,e[12],0,8),v=i(v,10),d=a(d,p,b,v,m,e[15],0,5),b=i(b,10),m=a(m,d,p,b,v,e[10],0,12),p=i(p,10),v=a(v,m,d,p,b,e[4],0,9),d=i(d,10),b=a(b,v,m,d,p,e[1],0,12),m=i(m,10),p=a(p,b,v,m,d,e[5],0,5),v=i(v,10),d=a(d,p,b,v,m,e[8],0,14),b=i(b,10),m=a(m,d,p,b,v,e[7],0,6),p=i(p,10),v=a(v,m,d,p,b,e[6],0,8),d=i(d,10),b=a(b,v,m,d,p,e[2],0,13),m=i(m,10),p=a(p,b,v,m,d,e[13],0,6),v=i(v,10),d=a(d,p,b,v,m,e[14],0,5),b=i(b,10),m=a(m,d,p,b,v,e[0],0,15),p=i(p,10),v=a(v,m,d,p,b,e[3],0,13),d=i(d,10),b=a(b,v,m,d,p,e[9],0,11),m=i(m,10),p=a(p,b,v,m,d,e[11],0,11),v=i(v,10);var g=this._b+c+v|0;this._b=this._c+h+m|0,this._c=this._d+l+d|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=g},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=n}).call(t,r(7).Buffer)},function(e,t,r){"use strict";(function(t){function n(e){i.call(this),this._block=new t(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var i=r(50).Transform;r(1)(n,i),n.prototype._transform=function(e,r,n){var i=null;try{"buffer"!==r&&(e=new t(e,r)),this.update(e)}catch(e){i=e}n(i)},n.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,r){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");t.isBuffer(e)||(e=new t(e,r||"binary"));for(var n=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},n.prototype._update=function(e){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=n}).call(t,r(7).Buffer)},function(e,t){},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){e.copy(t,r)}var a=r(5).Buffer,o=r(93);e.exports=function(){function e(){n(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)i(r.data,t,n),n+=r.data.length,r=r.next;return t},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>27}function a(e){return e<<30|e>>>2}function o(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var s=r(1),f=r(18),u=r(5).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);s(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,s=0|this._c,f=0|this._d,u=0|this._e,h=0;h<16;++h)t[h]=e.readInt32BE(4*h);for(;h<80;++h)t[h]=t[h-3]^t[h-8]^t[h-14]^t[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=i(r)+o(d,n,s,f)+u+t[l]+c[d]|0;u=f,f=s,s=a(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=f+this._d|0,this._e=u+this._e|0},n.prototype._hash=function(){var e=u.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=l,u.call(this,64,56)}function i(e){return e<<1|e>>>31}function a(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var f=r(1),u=r(18),c=r(5).Buffer,h=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);f(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,f=0|this._c,u=0|this._d,c=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=i(t[l-3]^t[l-8]^t[l-14]^t[l-16]);for(var d=0;d<80;++d){var p=~~(d/20),b=a(r)+s(p,n,f,u)+c+t[d]+h[p]|0;c=u,u=f,f=o(n),n=r,r=b}this._a=r+this._a|0,this._b=n+this._b|0,this._c=f+this._c|0,this._d=u+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var e=c.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=f,o.call(this,64,56)}var i=r(1),a=r(55),o=r(18),s=r(5).Buffer,f=new Array(64);i(n,a),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=f,o.call(this,128,112)}var i=r(1),a=r(56),o=r(18),s=r(5).Buffer,f=new Array(160);i(n,a),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=s.allocUnsafe(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=n},function(e,t,r){function n(e){a.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var i=r(5).Buffer,a=r(50).Transform,o=r(35).StringDecoder;r(1)(n,a),n.prototype.update=function(e,t,r){"string"==typeof e&&(e=i.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},n.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},n.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return e&&(t=this._toString(t,e,!0)),t},n.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=n},function(e,t,r){"use strict";var n=r(36),i=r(5).Buffer;e.exports=function(e){function t(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))}function r(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}function a(e){var t=n.decodeUnsafe(e);if(t)return r(t)}function o(t){var i=n.decode(t),a=r(i,e);if(!a)throw new Error("Invalid checksum");return a}return{encode:t,decode:o,decodeUnsafe:a}}},function(e,t,r){var n=r(5).Buffer;e.exports=function(e){function t(t){if(0===t.length)return"";for(var r=[0],n=0;n0;)r.push(a%o),a=a/o|0}for(var f="",u=0;0===t[u]&&u=0;--c)f+=e[r[c]];return f}function r(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.allocUnsafe(0);for(var t=[0],r=0;r>=8;for(;u>0;)t.push(255&u),u>>=8}for(var c=0;e[c]===s&&c=0;){var a;if(i.isOdd()){var o=i.andln(n-1);a=o>(n>>1)-1?(n>>1)-o:o,i.isubn(a)}else a=0;r.push(a);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,o=t.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var f=e.andln(7)+n&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var u;if(0==(1&o))u=0;else{var f=t.andln(7)+i&7;u=3!==f&&5!==f||2!==a?o:-o}r[1].push(u),2*n===s+1&&(n=1-n),2*i===u+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function a(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function o(e){return"string"==typeof e?f.toArray(e,"hex"):e}function s(e){return new u(e,"hex","le")}var f=t,u=r(13),c=r(16),h=r(58);f.assert=c,f.toArray=h.toArray,f.zero2=h.zero2,f.toHex=h.toHex,f.encode=h.encode,f.getNAF=n,f.getJSF=i,f.cachedProperty=a,f.parseBytes=o,f.intFromLE=s},function(e,t){},function(e,t,r){function n(e){this.rand=e}var i;if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,t){this.curve=e,this.type=t,this.precomputed=null}var a=r(13),o=r(8),s=o.utils,f=s.getNAF,u=s.getJSF,c=s.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(e,t){c(e.precomputed);var r=e._getDoubles(),n=f(t,1),i=(1<=o;t--)s=(s<<1)+n[t];a.push(s)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(var o=0;o=0;s--){for(var t=0;s>=0&&0===a[s];s--)t++;if(s>=0&&t++,o=o.dblp(t),s<0)break;var u=a[s];c(0!==u),o="affine"===e.type?u>0?o.mixedAdd(i[u-1>>1]):o.mixedAdd(i[-u-1>>1].neg()):u>0?o.add(i[u-1>>1]):o.add(i[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},n.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,h=0;h=1;h-=2){var p=h-1,b=h;if(1===a[p]&&1===a[b]){var v=[t[p],null,null,t[b]];0===t[p].y.cmp(t[b].y)?(v[1]=t[p].add(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg())):0===t[p].y.cmp(t[b].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].add(t[b].neg())):(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=u(r[p],r[b]);c=Math.max(g[0].length,c),s[p]=new Array(c),s[b]=new Array(c);for(var y=0;y=0;h--){for(var x=0;h>=0;){for(var A=!0,y=0;y=0&&x++,S=S.dblp(x),h<0)break;for(var y=0;y0?l=o[y][M-1>>1]:M<0&&(l=o[y][-M-1>>1].neg()),S="affine"===l.type?S.mixedAdd(l):S.add(l))}}for(var h=0;h=Math.ceil((e.bitLength()+1)/t.step)},i.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},n.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),f=i.mul(r.b),u=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:f.add(u).neg()}},n.prototype.pointFromX=function(e,t){e=new f(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.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(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},n.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(e){return e=new f(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},i.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},i.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},u(a,c.BasePoint),n.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),l=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(l)).redISub(a.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,d,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),u=f.redMul(o),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),l=s.redMul(c.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(h,l,d)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";function n(e){f.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,t,r){f.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(t,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(26),o=r(13),s=r(1),f=a.base,u=r(8),c=u.utils;s(n,f),e.exports=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},s(i,f.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},n.prototype.point=function(e,t){return new i(this,e,t)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,t){return new i(e,t[0],t[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=t.redSub(n),a=t.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(r),s=i.redMul(n),f=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,u)},i.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";function n(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,u.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function i(e,t,r,n,i){u.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(26),o=r(8),s=r(13),f=r(1),u=a.base,c=o.utils.assert;f(n,u),e.exports=n,n.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},n.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},n.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},n.prototype.pointFromX=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o)},n.prototype.pointFromY=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},n.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},f(i,u.BasePoint),n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},n.prototype.point=function(e,t,r,n){return new i(this,e,t,r,n)},i.fromJSON=function(e,t){return new i(e,t[0],t[1],t[2])},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),f=i.redMul(o),u=a.redMul(s),c=i.redMul(s),h=o.redMul(a);return this.curve.point(f,u,h,c)},i.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),s=o.redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),u=s.redSub(f).redISub(f);e=n.redSub(i).redISub(a).redMul(u),t=s.redMul(o.redSub(a)),r=s.redMul(u)}}else{var o=i.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=o.redSub(f).redSub(f);e=this.curve._mulC(n.redISub(o)).redMul(u),t=this.curve._mulC(o).redMul(i.redISub(a)),r=o.redMul(u)}return this.curve.point(e,t,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),u=a.redMul(o),c=s.redMul(f),h=a.redMul(f),l=o.redMul(s);return this.curve.point(u,c,l,h)},i.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),h=n.redMul(f).redMul(c);return this.curve.twisted?(t=n.redMul(u).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(u)):(t=n.redMul(u).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,t,r)},i.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},i.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},i.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},i.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},function(e,t,r){"use strict";function n(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new n(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}var a=t,o=r(37),s=r(8),f=s.utils.assert;a.PresetCurve=n,i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]});var u;try{u=r(125)}catch(e){u=void 0}i("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",u]})},function(e,t,r){"use strict";t.sha1=r(120),t.sha224=r(121),t.sha256=r(60),t.sha384=r(122),t.sha512=r(61)},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var i=r(12),a=r(23),o=r(59),s=i.rotl32,f=i.sum32,u=i.sum32_5,c=o.ft_1,h=a.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];i.inherits(n,h),e.exports=n,n.blockSize=512,n.outSize=160,n.hmacStrength=80,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},n.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},n.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),f=e.toArray("be",o),u=new a({hash:this.hash,entropy:s,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;!0;l++){var d=n.k?n.k(l):new i(u.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var m=d.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(m=m.umod(this.n),0!==m.cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new c({r:v,s:m,recoveryParam:g})}}}}}},n.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n),t=new c(t,"hex");var a=t.r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(e).umod(this.n),u=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var h=this.g.mulAdd(f,r.getPublic(),u);return!h.isInfinity()&&0===h.getX().umod(this.n).cmp(a)}var h=this.g.jmulAdd(f,r.getPublic(),u);return!h.isInfinity()&&h.eqXToP(a)},n.prototype.recoverPubKey=function(e,t,r,n){f((3&r)===r,"The recovery param is more than two bits"),t=new c(t,n);var a=this.n,o=new i(e),s=t.r,u=t.s,h=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var d=t.r.invm(a),p=a.sub(o).mul(d).umod(a),b=u.mul(d).umod(a);return this.g.mulAdd(p,s,b)},n.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new c(t,n),null!==t.recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var i=r(37),a=r(58),o=r(16);e.exports=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},n.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"}},function(e,t,r){"use strict";function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(h(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function i(){this.place=0}function a(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}var f=r(13),u=r(8),c=u.utils,h=c.assert;e.exports=n,n.prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new i;if(48!==e[r.place++])return!1;if(a(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=a(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=a(e,r);if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new f(o),this.s=new f(u),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,t.length),n=n.concat(t),n.push(2),s(n,r.length);var i=n.concat(r),a=[48];return s(a,i.length),a=a.concat(i),c.encode(a,e)}},function(e,t,r){"use strict";function n(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof n))return new n(e);var e=a.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}var i=r(37),a=r(8),o=a.utils,s=o.assert,f=o.parseBytes,u=r(131),c=r(132);e.exports=n,n.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},n.prototype.verify=function(e,t,r){e=f(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},n.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>>2]|=e[n]<<24-n%4*8;i.call(this,r,t)}else i.apply(this,arguments)}).prototype=n}}(),e.lib.WordArray})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return i.create(r,2*t)}};a.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],a=0;a>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a>>1]|=t(e.charCodeAt(a)<<16-a%2*16);return i.create(n,2*r)}}}(),e.enc.Utf16})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(63))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=t.algo,a=i.SHA256,o=i.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=a._createHelper(o),t.HmacSHA224=a._createHmacHelper(o)}(),e.SHA224})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27),r(64))}(0,function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),e.SHA384})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64,s=o.Word,f=r.algo,u=[],c=[],h=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,o=0;o<24;o++){for(var f=0,l=0,d=0;d<7;d++){if(1&a){var p=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=r[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var d=0;d<5;d++){for(var p=0,b=0,v=0;v<5;v++){var s=r[d+5*v];p^=s.high,b^=s.low}var m=l[d];m.high=p,m.low=b}for(var d=0;d<5;d++)for(var g=l[(d+4)%5],y=l[(d+1)%5],w=y.high,_=y.low,p=g.high^(w<<1|_>>>31),b=g.low^(_<<1|w>>>31),v=0;v<5;v++){var s=r[d+5*v];s.high^=p,s.low^=b}for(var S=1;S<25;S++){var s=r[S],k=s.high,x=s.low,A=u[S];if(A<32)var p=k<>>32-A,b=x<>>32-A;else var p=x<>>64-A,b=k<>>64-A;var M=l[c[S]];M.high=p,M.low=b}var E=l[0],I=r[0];E.high=I.high,E.low=I.low;for(var d=0;d<5;d++)for(var v=0;v<5;v++){var S=d+5*v,s=r[S],T=l[S],R=l[(d+1)%5+5*v],P=l[(d+2)%5+5*v];s.high=T.high^~R.high&P.high,s.low=T.low^~R.low&P.low}var s=r[0],B=h[f];s.high^=B.high,s.low^=B.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,f=s/8,u=[],c=0;c>>24)|4278255360&(l<<24|l>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(l)}return new i.init(u,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(d),r.HmacSHA3=a._createHmacHelper(d)}(Math),e.SHA3})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){/** @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: @@ -14,15 +14,15 @@ var G=r(83),Q=r(84),$=r(48);t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,a.T 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. */ -return function(t){function r(e,t,r){return e^t^r}function n(e,t,r){return e&t|~e&r}function i(e,t,r){return(e|~t)^r}function a(e,t,r){return e&r|t&~r}function o(e,t,r){return e^(t|~r)}function s(e,t){return e<>>32-t}var f=e,u=f.lib,c=u.WordArray,h=u.Hasher,l=f.algo,d=c.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]),p=c.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]),b=c.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]),v=c.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]),m=c.create([0,1518500249,1859775393,2400959708,2840853838]),g=c.create([1352829926,1548603684,1836072691,2053994217,0]),y=l.RIPEMD160=h.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var f=0;f<16;f++){var u=t+f,c=e[u];e[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var h,l,y,w,_,S,k,x,A,M,E=this._hash.words,I=m.words,T=g.words,P=d.words,R=p.words,B=b.words,C=v.words;S=h=E[0],k=l=E[1],x=y=E[2],A=w=E[3],M=_=E[4];for(var O,f=0;f<80;f+=1)O=h+e[t+P[f]]|0,O+=f<16?r(l,y,w)+I[0]:f<32?n(l,y,w)+I[1]:f<48?i(l,y,w)+I[2]:f<64?a(l,y,w)+I[3]:o(l,y,w)+I[4],O|=0,O=s(O,B[f]),O=O+_|0,h=_,_=w,w=s(y,10),y=l,l=O,O=S+e[t+R[f]]|0,O+=f<16?o(k,x,A)+T[0]:f<32?a(k,x,A)+T[1]:f<48?i(k,x,A)+T[2]:f<64?n(k,x,A)+T[3]:r(k,x,A)+T[4],O|=0,O=s(O,C[f]),O=O+M|0,S=M,M=A,A=s(x,10),x=k,k=O;O=E[1]+y+A|0,E[1]=E[2]+w+M|0,E[2]=E[3]+_+S|0,E[3]=E[4]+h+k|0,E[4]=E[0]+l+x|0,E[0]=O},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=h.clone.call(this);return e._hash=this._hash.clone(),e}});f.RIPEMD160=h._createHelper(y),f.HmacRIPEMD160=h._createHmacHelper(y)}(Math),e.RIPEMD160})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(38),r(39))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.SHA1,s=a.HMAC,f=a.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=s.create(r.hasher,e),a=i.create(),o=i.create([1]),f=a.words,u=o.words,c=r.keySize,h=r.iterations;f.length>>32-t}var f=e,u=f.lib,c=u.WordArray,h=u.Hasher,l=f.algo,d=c.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]),p=c.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]),b=c.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]),v=c.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]),m=c.create([0,1518500249,1859775393,2400959708,2840853838]),g=c.create([1352829926,1548603684,1836072691,2053994217,0]),y=l.RIPEMD160=h.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var f=0;f<16;f++){var u=t+f,c=e[u];e[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var h,l,y,w,_,S,k,x,A,M,E=this._hash.words,I=m.words,T=g.words,R=d.words,P=p.words,B=b.words,C=v.words;S=h=E[0],k=l=E[1],x=y=E[2],A=w=E[3],M=_=E[4];for(var O,f=0;f<80;f+=1)O=h+e[t+R[f]]|0,O+=f<16?r(l,y,w)+I[0]:f<32?n(l,y,w)+I[1]:f<48?i(l,y,w)+I[2]:f<64?a(l,y,w)+I[3]:o(l,y,w)+I[4],O|=0,O=s(O,B[f]),O=O+_|0,h=_,_=w,w=s(y,10),y=l,l=O,O=S+e[t+P[f]]|0,O+=f<16?o(k,x,A)+T[0]:f<32?a(k,x,A)+T[1]:f<48?i(k,x,A)+T[2]:f<64?n(k,x,A)+T[3]:r(k,x,A)+T[4],O|=0,O=s(O,C[f]),O=O+M|0,S=M,M=A,A=s(x,10),x=k,k=O;O=E[1]+y+A|0,E[1]=E[2]+w+M|0,E[2]=E[3]+_+S|0,E[3]=E[4]+h+k|0,E[4]=E[0]+l+x|0,E[0]=O},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=h.clone.call(this);return e._hash=this._hash.clone(),e}});f.RIPEMD160=h._createHelper(y),f.HmacRIPEMD160=h._createHmacHelper(y)}(Math),e.RIPEMD160})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(38),r(39))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.SHA1,s=a.HMAC,f=a.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=s.create(r.hasher,e),a=i.create(),o=i.create([1]),f=a.words,u=o.words,c=r.keySize,h=r.iterations;f.length>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var n=e.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var f=0;f>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.CipherParams,a=r.enc,o=a.Hex,s=r.format;s.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}}}(),e.format.Hex})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(16),r(3))}(0,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,a=[],o=[],s=[],f=[],u=[],c=[],h=[],l=[],d=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=0,n=0,t=0;t<256;t++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,a[r]=i,o[i]=r;var b=e[r],v=e[b],m=e[v],g=257*e[i]^16843008*i;s[r]=g<<24|g>>>8,f[r]=g<<16|g>>>16,u[r]=g<<8|g>>>24,c[r]=g;var g=16843009*m^65537*v^257*b^16843008*r;h[i]=g<<24|g>>>8,l[i]=g<<16|g>>>16,d[i]=g<<8|g>>>24,p[i]=g,r?(r=b^e[e[e[m^b]]],n^=e[e[n]]):r=n=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=this._nRounds=r+6,i=4*(n+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(f=a[f>>>24]<<24|a[f>>>16&255]<<16|a[f>>>8&255]<<8|a[255&f]):(f=f<<8|f>>>24,f=a[f>>>24]<<24|a[f>>>16&255]<<16|a[f>>>8&255]<<8|a[255&f],f^=b[s/r|0]<<24),o[s]=o[s-r]^f}for(var u=this._invKeySchedule=[],c=0;c>>24]]^l[a[f>>>16&255]]^d[a[f>>>8&255]]^p[a[255&f]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,f,u,c,a)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,h,l,d,p,o);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var f=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p>>24]^i[c>>>16&255]^a[h>>>8&255]^o[255&l]^r[d++],v=n[c>>>24]^i[h>>>16&255]^a[l>>>8&255]^o[255&u]^r[d++],m=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[255&c]^r[d++],g=n[l>>>24]^i[u>>>16&255]^a[c>>>8&255]^o[255&h]^r[d++];u=b,c=v,h=m,l=g}var b=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^r[d++],m=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^r[d++],g=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[d++];e[t]=b,e[t+1]=v,e[t+2]=m,e[t+3]=g},keySize:8});t.AES=n._createHelper(v)}(),e.AES})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(16),r(3))}(0,function(e){return function(){function t(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>5]>>>31-i%32&1}for(var a=this._subKeys=[],o=0;o<16;o++){for(var s=a[o]=[],h=c[o],n=0;n<24;n++)s[n/6|0]|=r[(u[n]-1+h)%28]<<31-n%6,s[4+(n/6|0)]|=r[28+(u[n+24]-1+h)%28]<<31-n%6;s[0]=s[0]<<1|s[0]>>>31;for(var n=1;n<7;n++)s[n]=s[n]>>>4*(n-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var l=this._invSubKeys=[],n=0;n<16;n++)l[n]=a[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,n,i){this._lBlock=e[n],this._rBlock=e[n+1],t.call(this,4,252645135),t.call(this,16,65535),r.call(this,2,858993459),r.call(this,8,16711935),t.call(this,1,1431655765);for(var a=0;a<16;a++){for(var o=i[a],s=this._lBlock,f=this._rBlock,u=0,c=0;c<8;c++)u|=h[c][((f^o[c])&l[c])>>>0];this._lBlock=f,this._rBlock=s^u}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,t.call(this,1,1431655765),r.call(this,8,16711935),r.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),e[n]=this._lBlock,e[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=o._createHelper(d);var p=s.TripleDES=o.extend({_doReset:function(){var e=this._key,t=e.words;this._des1=d.createEncryptor(a.create(t.slice(0,2))),this._des2=d.createEncryptor(a.create(t.slice(2,4))),this._des3=d.createEncryptor(a.create(t.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});n.TripleDES=o._createHelper(p)}(),e.TripleDES})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(16),r(3))}(0,function(e){return function(){function t(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){t=(t+1)%256,r=(r+e[t])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=a.RC4=i.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var f=n[i];n[i]=n[a],n[a]=f}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=t.call(this)},keySize:8,ivSize:0});r.RC4=i._createHelper(o);var s=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)t.call(this)}});r.RC4Drop=i._createHelper(s)}(),e.RC4})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(16),r(3))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,o=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);f[r]=o^u}e[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,e[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,e[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,e[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,e[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,e[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,e[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,e[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=[],s=[],f=[],u=a.Rabbit=i.extend({_doReset:function(){for(var e=this._key.words,r=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var n=0;n<4;n++)t.call(this);for(var n=0;n<8;n++)a[n]^=i[n+4&7];if(r){var o=r.words,s=o[0],f=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=u>>>16|4294901760&c,l=c<<16|65535&u;a[0]^=u,a[1]^=h,a[2]^=c,a[3]^=l,a[4]^=u,a[5]^=h,a[6]^=c,a[7]^=l;for(var n=0;n<4;n++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[r+i]^=o[i]},blockSize:4,ivSize:2});r.Rabbit=i._createHelper(u)}(),e.Rabbit})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(16),r(3))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,o=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);f[r]=o^u}e[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,e[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,e[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,e[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,e[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,e[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,e[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,e[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=[],s=[],f=[],u=a.RabbitLegacy=i.extend({_doReset:function(){var e=this._key.words,r=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var a=0;a<4;a++)t.call(this);for(var a=0;a<8;a++)i[a]^=n[a+4&7];if(r){var o=r.words,s=o[0],f=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=u>>>16|4294901760&c,l=c<<16|65535&u;i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=l,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=l;for(var a=0;a<4;a++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[r+i]^=o[i]},blockSize:4,ivSize:2});r.RabbitLegacy=i._createHelper(u)}(),e.RabbitLegacy})},function(e,t,r){var n;!function(i){"use strict";function a(e){function t(e,n){var i,a,o,s,f,u,c=this;if(!(c instanceof t))return new t(e,n);if(null!=n&&K(n,2,64,O,"base")){if(n|=0,u=e+"",10==n)return c=new t(e instanceof t?e:u),R(c,z+c.e+1,L);if((s="number"==typeof e)&&0*e!=0||!new RegExp("^-?"+(i="["+S.slice(0,n)+"]+")+"(?:\\."+i+")?$",n<37?"i":"").test(u))return C(c,u,s,n);s?(c.s=1/e<0?(u=u.slice(1),-1):1,q&&u.replace(/^0\.0*|\./,"").length>15&&P(O,_,e),s=!1):c.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=r(u,10,n,c.s)}else{if(e instanceof t)return c.s=e.s,c.e=e.e,c.c=(e=e.c)?e.slice():e,void(O=0);if((s="number"==typeof e)&&0*e==0){if(c.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,o=e;o>=10;o/=10,a++);return c.e=a,c.c=[e],void(O=0)}u=e+""}else{if(!v.test(u=e+""))return C(c,u,s);c.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((a=u.indexOf("."))>-1&&(u=u.replace(".","")),(o=u.search(/e/i))>0?(a<0&&(a=o),a+=+u.slice(o+1),u=u.substring(0,o)):a<0&&(a=u.length),o=0;48===u.charCodeAt(o);o++);for(f=u.length;48===u.charCodeAt(--f););if(u=u.slice(o,f+1))if(f=u.length,s&&q&&f>15&&(e>A||e!==g(e))&&P(O,_,c.s*e),(a=a-o-1)>D)c.c=c.e=null;else if(a=0&&(f=W,W=0,e=e.replace(".",""),p=new t(n),c=p.pow(e.length-b),W=f,p.c=h(d(s(c.c),c.e),10,r),p.e=p.c.length),l=h(e,n,r),o=f=l.length;0==l[--f];l.pop());if(!l[0])return"0";if(b<0?--o:(c.c=l,c.e=o,c.s=i,c=B(c,p,v,m,r),l=c.c,u=c.r,o=c.e),a=o+v+1,b=l[a],f=r/2,u=u||a<0||null!=l[a+1],u=m<4?(null!=b||u)&&(0==m||m==(c.s<0?3:2)):b>f||b==f&&(4==m||u||6==m&&1&l[a-1]||m==(c.s<0?8:7)),a<1||!l[0])e=u?d("1",-v):"0";else{if(l.length=a,u)for(--r;++l[--a]>r;)l[a]=0,a||(++o,l=[1].concat(l));for(f=l.length;!l[--f];);for(b=0,e="";b<=f;e+=S.charAt(l[b++]));e=d(e,o)}return e}function n(e,r,n,i){var a,o,f,u,c;if(n=null!=n&&K(n,0,8,i,w)?0|n:L,!e.c)return e.toString();if(a=e.c[0],f=e.e,null==r)c=s(e.c),c=19==i||24==i&&f<=F?l(c,f):d(c,f);else if(e=R(new t(e),r,n),o=e.e,c=s(e.c),u=c.length,19==i||24==i&&(r<=o||o<=F)){for(;uu){if(--r>0)for(c+=".";r--;c+="0");}else if((r+=o-u)>0)for(o+1==u&&(c+=".");r--;c+="0");return e.s<0&&a?"-"+c:c}function i(e,r){var n,i,a=0;for(c(e[0])&&(e=e[0]),n=new t(e[0]);++ar||e!=p(e))&&P(n,(i||"decimal places")+(er?" out of range":" not an integer"),e),!0}function T(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*x-1)>D?e.c=e.e=null:r=10;s/=10,i++);if((a=t-i)<0)a+=x,o=t,f=h[u=0],c=f/l[i-o-1]%10|0;else if((u=m((a+1)/x))>=h.length){if(!n)break e;for(;h.length<=u;h.push(0));f=c=0,i=1,a%=x,o=a-x+1}else{for(f=s=h[u],i=1;s>=10;s/=10,i++);a%=x,o=a-x+i,c=o<0?0:f/l[i-o-1]%10|0}if(n=n||t<0||null!=h[u+1]||(o<0?f:f%l[i-o-1]),n=r<4?(c||n)&&(0==r||r==(e.s<0?3:2)):c>5||5==c&&(4==r||n||6==r&&(a>0?o>0?f/l[i-o]:0:h[u-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,n?(t-=e.e+1,h[0]=l[(x-t%x)%x],e.e=-t||0):h[0]=e.e=0,e;if(0==a?(h.length=u,s=1,u--):(h.length=u+1,s=l[x-a],h[u]=o>0?g(f/l[i-o]%l[o])*s:0),n)for(;;){if(0==u){for(a=1,o=h[0];o>=10;o/=10,a++);for(o=h[0]+=s,s=1;o>=10;o/=10,s++);a!=s&&(e.e++,h[0]==k&&(h[0]=1));break}if(h[u]+=s,h[u]!=k)break;h[u--]=0,s=1}for(a=h.length;0===h[--a];h.pop());}e.e>D?e.c=e.e=null:e.er)return null!=(e=i[r++])};return o(t="DECIMAL_PLACES")&&K(e,0,I,2,t)&&(z=0|e),n[t]=z,o(t="ROUNDING_MODE")&&K(e,0,8,2,t)&&(L=0|e),n[t]=L,o(t="EXPONENTIAL_AT")&&(c(e)?K(e[0],-I,0,2,t)&&K(e[1],0,I,2,t)&&(F=0|e[0],H=0|e[1]):K(e,-I,I,2,t)&&(F=-(H=0|(e<0?-e:e)))),n[t]=[F,H],o(t="RANGE")&&(c(e)?K(e[0],-I,-1,2,t)&&K(e[1],1,I,2,t)&&(U=0|e[0],D=0|e[1]):K(e,-I,I,2,t)&&(0|e?U=-(D=0|(e<0?-e:e)):q&&P(2,t+" cannot be zero",e))),n[t]=[U,D],o(t="ERRORS")&&(e===!!e||1===e||0===e?(O=0,K=(q=!!e)?b:u):q&&P(2,t+y,e)),n[t]=q,o(t="CRYPTO")&&(!0===e||!1===e||1===e||0===e?e?(e="undefined"==typeof crypto,!e&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?Y=!0:q?P(2,"crypto unavailable",e?void 0:crypto):Y=!1):Y=!1:q&&P(2,t+y,e)),n[t]=Y,o(t="MODULO_MODE")&&K(e,0,9,2,t)&&(V=0|e),n[t]=V,o(t="POW_PRECISION")&&K(e,0,I,2,t)&&(W=0|e),n[t]=W,o(t="FORMAT")&&("object"==typeof e?X=e:q&&P(2,t+" not an object",e)),n[t]=X,n},t.max=function(){return i(arguments,N.lt)},t.min=function(){return i(arguments,N.gt)},t.random=function(){var e=9007199254740992*Math.random()&2097151?function(){return g(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(r){var n,i,a,o,s,f=0,u=[],c=new t(j);if(r=null!=r&&K(r,0,I,14)?0|r:z,o=m(r/x),Y)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(o*=2));f>>11),s>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),n[f]=i[0],n[f+1]=i[1]):(u.push(s%1e14),f+=2);f=o/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(o*=7);f=9e15?crypto.randomBytes(7).copy(n,f):(u.push(s%1e14),f+=7);f=o/7}else Y=!1,q&&P(14,"crypto unavailable",crypto);if(!Y)for(;f=10;s/=10,f++);fn?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(i,a,s,f,u){var c,h,l,d,p,b,v,m,y,w,_,S,A,M,E,I,T,P=i.s==a.s?1:-1,B=i.c,C=a.c;if(!(B&&B[0]&&C&&C[0]))return new t(i.s&&a.s&&(B?!C||B[0]!=C[0]:C)?B&&0==B[0]||!C?0*P:P/0:NaN);for(m=new t(P),y=m.c=[],h=i.e-a.e,P=s+h+1,u||(u=k,h=o(i.e/x)-o(a.e/x),P=P/x|0),l=0;C[l]==(B[l]||0);l++);if(C[l]>(B[l]||0)&&h--,P<0)y.push(1),d=!0;else{for(M=B.length,I=C.length,l=0,P+=2,p=g(u/(C[0]+1)),p>1&&(C=e(C,p,u),B=e(B,p,u),I=C.length,M=B.length),A=I,w=B.slice(0,I),_=w.length;_=u/2&&E++;do{if(p=0,(c=r(C,w,I,_))<0){if(S=w[0],I!=_&&(S=S*u+(w[1]||0)),(p=g(S/E))>1)for(p>=u&&(p=u-1),b=e(C,p,u),v=b.length,_=w.length;1==r(b,w,v,_);)p--,n(b,I=10;P/=10,l++);R(m,s+(m.e=l+h*x-1)+1,f,d)}else m.e=h,m.r=+d;return m}}(),C=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,n=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,f,u){var c,h=f?s:s.replace(a,"");if(i.test(h))o.s=isNaN(h)?null:h<0?-1:1;else{if(!f&&(h=h.replace(e,function(e,t,r){return c="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=c?e:t}),u&&(c=u,h=h.replace(r,"$1").replace(n,"0.$1")),s!=h))return new t(h,c);q&&P(O,"not a"+(u?" base "+u:"")+" number",s),o.s=null}o.c=o.e=null,O=0}}(),N.absoluteValue=N.abs=function(){var e=new t(this);return e.s<0&&(e.s=1),e},N.ceil=function(){return R(new t(this),this.e+1,2)},N.comparedTo=N.cmp=function(e,r){return O=1,f(this,new t(e,r))},N.decimalPlaces=N.dp=function(){var e,t,r=this.c;if(!r)return null;if(e=((t=r.length-1)-o(this.e/x))*x,t=r[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},N.dividedBy=N.div=function(e,r){return O=3,B(this,new t(e,r),z,L)},N.dividedToIntegerBy=N.divToInt=function(e,r){return O=4,B(this,new t(e,r),0,1)},N.equals=N.eq=function(e,r){return O=5,0===f(this,new t(e,r))},N.floor=function(){return R(new t(this),this.e+1,3)},N.greaterThan=N.gt=function(e,r){return O=6,f(this,new t(e,r))>0},N.greaterThanOrEqualTo=N.gte=function(e,r){return O=7,1===(r=f(this,new t(e,r)))||0===r},N.isFinite=function(){return!!this.c},N.isInteger=N.isInt=function(){return!!this.c&&o(this.e/x)>this.c.length-2},N.isNaN=function(){return!this.s},N.isNegative=N.isNeg=function(){return this.s<0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.lessThan=N.lt=function(e,r){return O=8,f(this,new t(e,r))<0},N.lessThanOrEqualTo=N.lte=function(e,r){return O=9,-1===(r=f(this,new t(e,r)))||0===r},N.minus=N.sub=function(e,r){var n,i,a,s,f=this,u=f.s;if(O=10,e=new t(e,r),r=e.s,!u||!r)return new t(NaN);if(u!=r)return e.s=-r,f.plus(e);var c=f.e/x,h=e.e/x,l=f.c,d=e.c;if(!c||!h){if(!l||!d)return l?(e.s=-r,e):new t(d?f:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-r,e):new t(l[0]?f:3==L?-0:0)}if(c=o(c),h=o(h),l=l.slice(),u=c-h){for((s=u<0)?(u=-u,a=l):(h=c,a=d),a.reverse(),r=u;r--;a.push(0));a.reverse()}else for(i=(s=(u=l.length)<(r=d.length))?u:r,u=r=0;r0)for(;r--;l[n++]=0);for(r=k-1;i>u;){if(l[--i]0?(f=s,n=c):(a=-a,n=u),n.reverse();a--;n.push(0));n.reverse()}for(a=u.length,r=c.length,a-r<0&&(n=c,c=u,u=n,r=a),a=0;r;)a=(u[--r]=u[r]+c[r]+a)/k|0,u[r]=k===u[r]?0:u[r]%k;return a&&(u=[a].concat(u),++f),T(e,u,f)},N.precision=N.sd=function(e){var t,r,n=this,i=n.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(q&&P(13,"argument"+y,e),e!=!!e&&(e=null)),!i)return null;if(r=i.length-1,t=r*x+1,r=i[r]){for(;r%10==0;r/=10,t--);for(r=i[0];r>=10;r/=10,t++);}return e&&n.e+1>t&&(t=n.e+1),t},N.round=function(e,r){var n=new t(this);return(null==e||K(e,0,I,15))&&R(n,~~e+this.e+1,null!=r&&K(r,0,8,15,w)?0|r:L),n},N.shift=function(e){var r=this;return K(e,-A,A,16,"argument")?r.times("1e"+p(e)):new t(r.c&&r.c[0]&&(e<-A||e>A)?r.s*(e<0?0:1/0):r)},N.squareRoot=N.sqrt=function(){var e,r,n,i,a,f=this,u=f.c,c=f.s,h=f.e,l=z+4,d=new t("0.5");if(1!==c||!u||!u[0])return new t(!c||c<0&&(!u||u[0])?NaN:u?f:1/0);if(c=Math.sqrt(+f),0==c||c==1/0?(r=s(u),(r.length+h)%2==0&&(r+="0"),c=Math.sqrt(r),h=o((h+1)/2)-(h<0||h%2),c==1/0?r="1e"+h:(r=c.toExponential(),r=r.slice(0,r.indexOf("e")+1)+h),n=new t(r)):n=new t(c+""),n.c[0])for(h=n.e,c=h+l,c<3&&(c=0);;)if(a=n,n=d.times(a.plus(B(f,a,l,1))),s(a.c).slice(0,c)===(r=s(n.c)).slice(0,c)){if(n.e=0;){for(n=0,p=_[a]%g,b=_[a]/g|0,f=c,s=a+f;s>a;)h=w[--f]%g,l=w[f]/g|0,u=b*h+l*p,h=p*h+u%g*g+v[s]+n,n=(h/m|0)+(u/g|0)+b*l,v[s--]=h%m;v[s]=n}return n?++i:v.splice(0,1),T(e,v,i)},N.toDigits=function(e,r){var n=new t(this);return e=null!=e&&K(e,1,I,18,"precision")?0|e:null,r=null!=r&&K(r,0,8,18,w)?0|r:L,e?R(n,e,r):n},N.toExponential=function(e,t){return n(this,null!=e&&K(e,0,I,19)?1+~~e:null,t,19)},N.toFixed=function(e,t){return n(this,null!=e&&K(e,0,I,20)?~~e+this.e+1:null,t,20)},N.toFormat=function(e,t){var r=n(this,null!=e&&K(e,0,I,21)?~~e+this.e+1:null,t,21);if(this.c){var i,a=r.split("."),o=+X.groupSize,s=+X.secondaryGroupSize,f=X.groupSeparator,u=a[0],c=a[1],h=this.s<0,l=h?u.slice(1):u,d=l.length;if(s&&(i=o,o=s,s=i,d-=i),o>0&&d>0){for(i=d%o||o,u=l.substr(0,i);i0&&(u+=f+l.slice(i)),h&&(u="-"+u)}r=c?u+X.decimalSeparator+((s=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return r},N.toFraction=function(e){var r,n,i,a,o,f,u,c,h,l=q,d=this,p=d.c,b=new t(j),v=n=new t(j),m=u=new t(j);if(null!=e&&(q=!1,f=new t(e),q=l,(l=f.isInt())&&!f.lt(j)||(q&&P(22,"max denominator "+(l?"out of range":"not an integer"),e),e=!l&&f.c&&R(f,f.e+1,1).gte(j)?f:null)),!p)return d.toString();for(h=s(p),a=b.e=h.length-d.e-1,b.c[0]=M[(o=a%x)<0?x+o:o],e=!e||f.cmp(b)>0?a>0?b:v:f,o=D,D=1/0,f=new t(h),u.c[0]=0;c=B(f,b,0,1),i=n.plus(c.times(m)),1!=i.cmp(e);)n=m,m=i,v=u.plus(c.times(i=v)),u=i,b=f.minus(c.times(i=b)),f=i;return i=B(e.minus(n),m,0,1),u=u.plus(i.times(v)),n=n.plus(i.times(m)),u.s=v.s=d.s,a*=2,r=B(v,m,a,L).minus(d).abs().cmp(B(u,n,a,L).minus(d).abs())<1?[v.toString(),m.toString()]:[u.toString(),n.toString()],D=o,r},N.toNumber=function(){return+this},N.toPower=N.pow=function(e,r){var n,i,a,o=g(e<0?-e:+e),s=this;if(null!=r&&(O=23,r=new t(r)),!K(e,-A,A,23,"exponent")&&(!isFinite(e)||o>A&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return n=Math.pow(+s,e),new t(r?n%r:n);for(r?e>1&&s.gt(j)&&s.isInt()&&r.gt(j)&&r.isInt()?s=s.mod(r):(a=r,r=null):W&&(n=m(W/x+2)),i=new t(j);;){if(o%2){if(i=i.times(s),!i.c)break;n?i.c.length>n&&(i.c.length=n):r&&(i=i.mod(r))}if(!(o=g(o/2)))break;s=s.times(s),n?s.c&&s.c.length>n&&(s.c.length=n):r&&(s=s.mod(r))}return r?i:(e<0&&(i=j.div(i)),a?i.mod(a):n?R(i,W,L):i)},N.toPrecision=function(e,t){return n(this,null!=e&&K(e,1,I,24,"precision")?0|e:null,t,24)},N.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(t=s(n.c),t=null!=e&&K(e,2,64,25,"base")?r(d(t,a),0|e,10,i):a<=F||a>=H?l(t,a):d(t,a),i<0&&n.c[0]&&(t="-"+t)),t},N.truncated=N.trunc=function(){return R(new t(this),this.e+1,1)},N.valueOf=N.toJSON=function(){var e,t=this,r=t.e;return null===r?t.toString():(e=s(t.c),e=r<=F||r>=H?l(e,r):d(e,r),t.s<0?"-"+e:e)},N.isBigNumber=!0,null!=e&&t.config(e),t}function o(e){var t=0|e;return e>0||e===t?t:t-1}function s(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nu^r?1:-1;for(s=(f=i.length)<(u=a.length)?f:u,o=0;oa[o]^r?1:-1;return f==u?0:f>u^r?1:-1}function u(e,t,r){return(e=p(e))>=t&&e<=r}function c(e){return"[object Array]"==Object.prototype.toString.call(e)}function h(e,t,r){for(var n,i,a=[0],o=0,s=e.length;or-1&&(null==a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}function l(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function d(e,t){var r,n;if(t<0){for(n="0.";++t;n+="0");e=n+e}else if(r=e.length,++t>r){for(n="0",t-=r;--t;n+="0");e+=n}else t=e)&&(n=e-1,console.error("invalid priority: "+a+" must be between 0 and "+n))),t[n].push(r)},n.dequeue=function(e){var r,n=null,a=t.length;for(i=null,r=0;ro.length);e+=1)a=l[e].timeout,s>=a&&(g("removeIdle() destroying obj - now:"+s+" timeout:"+a,"verbose"),o.push(l[e].obj));for(e=0,n=o.length;e0?(g("availableObjects.length="+r,"verbose"),i()):g("removeIdle() all objects removed","verbose")}function i(){b||(b=!0,v=setTimeout(n,c))}function a(){var e=null,r=d.size();if(g("dispense() clients="+r+" available="+l.length,"info"),r>0){for(;l.length>0;){if(g("dispense() - reusing obj","verbose"),e=l[0],t.validate(e.obj))return l.shift(),d.dequeue()(null,e.obj);f.destroy(e.obj)}p1?(t=arguments[0],r=arguments[1]):(t=arguments[0]instanceof Error?arguments[0]:null,r=arguments[0]instanceof Error?null:arguments[0]),t?(p-=1,n&&n(t,r),e.nextTick(function(){a()})):n?n(t,r):f.release(r)})}function s(){var e,r;if(!m&&p0?setTimeout(t,100):l.length!=p?setTimeout(t,100):e&&e()};t()},f.destroyAllNow=function(e){g("force destroying all objects","info");var t=l;l=[];for(var r=t.shift();null!==r&&void 0!==r;)f.destroy(r.obj),r=t.shift();b=!1,clearTimeout(v),e&&e()},f.pooled=function(e,t){return function(){var r=arguments,n=r[r.length-1],i="function"==typeof n;f.acquire(function(t,a){if(t)return void(i&&n(t));var o=[a].concat(Array.prototype.slice.call(r,0,i?-1:void 0));o.push(function(){f.release(a),i&&n.apply(null,arguments)}),e.apply(null,o)},t)}},f.getPoolSize=function(){return p},f.getName=function(){return t.name},f.availableObjectsCount=function(){return l.length},f.waitingClientsCount=function(){return d.size()},s(),f}}).call(t,r(10))},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,r){(function(t){var n=r(165),i=r(67);e.exports=function(e,r,a){for(var o=i.apply(null,arguments),s=n(o.options.maxmem),f=Array.prototype.slice.apply(o.password),r=Array.prototype.slice.apply(o.salt),u=s.crypto_scrypt(f,r,o.options.cost,o.options.blockSize,o.options.parallel,o.options.size),c=new t(u.length),h=0;hr?String.fromCharCode(r):(e.push(r),t=191r?1:2,"");if(0r?String.fromCharCode((31&r)<<6|63&n):String.fromCharCode((15&r)<<12|(63&n)<<6|63&i);return e.length=0,r},this.yb=function(e){for(var e=unescape(encodeURIComponent(e)),t=[],r=0;r>3<<3,t}function ra(e){var t=sa;return sa=sa+e|0,sa=sa+7>>3<<3,t}function ua(e){var t=z;return z=z+e|0,z=z+7>>3<<3,z>=va&&wa("Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value, or (2) set Module.TOTAL_MEMORY before the program runs."),t}function xa(e,t){return Math.ceil(e/(t||8))*(t||8)}function w(e,t){e||wa("Assertion failed: "+t)}function Ca(a){try{var b=s["_"+a];b||(b=eval("_"+a))}catch(e){}return w(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function Ba(e,t,r,n){function i(e,t){if("string"==t){if(e===m||e===k||0===e)return 0;a||(a=ja());var r=qa(e.length+1);return Da(e,r),r}return"array"==t?(a||(a=ja()),r=qa(e.length),Ea(e,r),r):e}var a=0,o=0,n=n?n.map(function(e){return i(e,r[o++])}):[];return e=e.apply(m,n),"string"==t?t=Fa(e):(w("array"!=t),t=e),a&&ka(a),t}function Ga(e,t,r){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":A[e]=t;break;case"i16":Ha[e>>1]=t;break;case"i32":B[e>>2]=t;break;case"i64":Aa=[t>>>0,(0|Math.min(+Math.floor(t/4294967296),4294967295))>>>0],B[e>>2]=Aa[0],B[e+4>>2]=Aa[1];break;case"float":Ia[e>>2]=t;break;case"double":Ja[e>>3]=t;break;default:wa("invalid type for setValue: "+r)}}function F(e,t,r,n){var i,a;"number"==typeof e?(i=l,a=e):(i=p,a=e.length);var o="string"==typeof t?t:m,r=r==Na?n:[Oa,qa,ra,ua][r===k?E:r](Math.max(a,o?1:t.length));if(i){for(n=r,w(0==(3&r)),e=r+(-4&a);n>2]=0;for(e=r+a;n=t?2*Math.abs(1<=e)return e;var r=32>=t?Math.abs(1<=r&&(32>=t||e>r)&&(e=-2*r+e),e}function ib(e){L++,s.monitorRunDependencies&&s.monitorRunDependencies(L),e?(w(!fb[e]),fb[e]=1):s.P("warning: run dependency added without ID")}function jb(e){L--,s.monitorRunDependencies&&s.monitorRunDependencies(L),e?(w(fb[e]),delete fb[e]):s.P("warning: run dependency removed without ID"),0==L&&(hb!==m&&(clearInterval(hb),hb=m),!gb&&kb&&lb())}function M(e){return B[rb>>2]=e}function vb(e,t,r){var n=O(e,{parent:l}).d,e="/"===e?"/":wb(e)[2],i=xb(n,e);return i&&g(new Q(i)),n.l.Ta||g(new Q(N.L)),n.l.Ta(n,e,t,r)}function yb(e,t){return t=4095&t|32768,vb(e,t,0)}function zb(e,t){return t=1023&t|16384,vb(e,t,0)}function Ab(e,t,r){return vb(e,8192|t,r)}function Bb(e,t){var r=O(t,{parent:l}).d,n="/"===t?"/":wb(t)[2],i=xb(r,n);return i&&g(new Q(i)),r.l.Wa||g(new Q(N.L)),r.l.Wa(r,n,e)}function Cb(e,t){var r;r="string"==typeof e?O(e,{N:l}).d:e,r.l.Y||g(new Q(N.L)),r.l.Y(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function Db(e,t){var r,n,e=Eb(e);"string"==typeof t?void 0===(n=Fb[t])&&g(Error("Unknown file open mode: "+t)):n=t,t=n,r=512&t?4095&r|32768:0;var i;try{var a=O(e,{N:!(65536&t)});i=a.d,e=a.path}catch(e){}512&t&&(i?2048&t&&g(new Q(N.va)):i=vb(e,r,0)),i||g(new Q(N.ca)),8192==(61440&i.mode)&&(t&=-1025),i?40960==(61440&i.mode)?r=N.ba:16384==(61440&i.mode)&&(0!=(3&t)||1024&t)?r=N.aa:(r=["r","w","rw"][3&t],1024&t&&(r+="w"),r=Gb(i,r)):r=N.ca,r&&g(new Q(r)),1024&t&&(r=i,r="string"==typeof r?O(r,{N:l}).d:r,r.l.Y||g(new Q(N.L)),16384==(61440&r.mode)&&g(new Q(N.aa)),32768!=(61440&r.mode)&&g(new Q(N.A)),(a=Gb(r,"w"))&&g(new Q(a)),r.l.Y(r,{size:0,timestamp:Date.now()}));var o,s={path:e,d:i,M:t,seekable:l,position:0,e:i.e,Gb:[],error:p};e:{for(i=k||4096,r=k||1;r<=i;r++)if(!R[r]){o=r;break e}g(new Q(N.Za))}return s.s=o,Object.defineProperty(s,"object",{get:function(){return s.d},set:function(e){s.d=e}}),Object.defineProperty(s,"isRead",{get:function(){return 1!=(3&s.M)}}),Object.defineProperty(s,"isWrite",{get:function(){return 0!=(3&s.M)}}),Object.defineProperty(s,"isAppend",{get:function(){return 8&s.M}}),R[o]=s,s.e.open&&s.e.open(s),s}function Hb(e){try{e.e.close&&e.e.close(e)}catch(e){g(e)}finally{R[e.s]=m}}function Ib(e,t,r,n,i){(0>n||0>i)&&g(new Q(N.A)),0==(3&e.M)&&g(new Q(N.$)),16384==(61440&e.d.mode)&&g(new Q(N.aa)),e.e.write||g(new Q(N.A));var a=l;return void 0===i?(i=e.position,a=p):e.seekable||g(new Q(N.da)),8&e.M&&((!e.seekable||!e.e.na)&&g(new Q(N.da)),e.e.na(e,0,2)),t=e.e.write(e,t,r,n,i),a||(e.position+=t),t}function wb(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)}function Jb(e,t){for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function Eb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1),e=Jb(e.split("/").filter(function(e){return!!e}),!t).join("/");return!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function S(){return Eb(Array.prototype.slice.call(arguments,0).filter(function(e){return"string"!=typeof e&&g(new TypeError("Arguments to path.join must be strings")),e}).join("/"))}function Kb(){for(var e="",t=p,r=arguments.length-1;-1<=r&&!t;r--){var n=0<=r?arguments[r]:"/";"string"!=typeof n&&g(new TypeError("Arguments to path.resolve must be strings")),n&&(e=n+"/"+e,t="/"===n.charAt(0))}return e=Jb(e.split("/").filter(function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."}function Mb(e,t){Lb[e]={input:[],H:[],O:t},Nb[e]={e:Ob}}function Q(e){this.mb=e;for(var t in N)if(N[t]===e){this.code=t;break}this.message=ub[e]}function Zb(e){e instanceof Q||g(e+" : "+Error().stack),M(e.mb)}function $b(e,t){for(var r=0,n=0;ne||0===e&&-1/0==1/e}function kc(e,t){function r(e){var r;return"double"===e?r=Ja[t+o>>3]:"i64"==e?(r=[B[t+o>>2],B[t+(o+8)>>2]],o+=8):(e="i32",r=B[t+o>>2]),o+=Math.max(Math.max(la(e),ma),8),r}for(var n,i,a=e,o=0,s=[];;){var f=a;if(0===(n=A[a]))break;if(i=A[a+1|0],37==n){var u=p,c=p,h=p,d=p;e:for(;;){switch(i){case 43:u=l;break;case 45:c=l;break;case 35:h=l;break;case 48:if(d)break e;d=l;break;default:break e}a++,i=A[a+1|0]}var b=0;if(42==i)b=r("i32"),a++,i=A[a+1|0];else for(;48<=i&&57>=i;)b=10*b+(i-48),a++,i=A[a+1|0];var v=p;if(46==i){var g=0,v=l;if(a++,42==(i=A[a+1|0]))g=r("i32"),a++;else for(;!(48>(i=A[a+1|0])||57>>0)+4294967296*+(n[1]>>>0):+(n[0]>>>0)+4294967296*+(0|n[1])),4>=y&&(n=(f?eb:db)(n&Math.pow(256,y)-1,8*y));var S=Math.abs(n),f="";if(100==i||105==i)w=8==y&&lc?lc.stringify(_[0],_[1],m):eb(n,8*y).toString(10);else if(117==i)w=8==y&&lc?lc.stringify(_[0],_[1],l):db(n,8*y).toString(10),n=Math.abs(n);else if(111==i)w=(h?"0":"")+S.toString(8);else if(120==i||88==i){if(f=h&&0!=n?"0x":"",8==y&&lc)if(_[1]){for(w=(_[1]>>>0).toString(16),h=(_[0]>>>0).toString(16);8>h.length;)h="0"+h;w+=h}else w=(_[0]>>>0).toString(16);else if(0>n){for(n=-n,w=(S-1).toString(16),_=[],h=0;hn?"-"+f:"+"+f);f.length+w.lengthy&&-4<=y?(i=(103==i?"f":"F").charCodeAt(0),g-=y+1):(i=(103==i?"e":"E").charCodeAt(0),g--),y=Math.min(g,20)),101==i||69==i?(w=n.toExponential(y),/[eE][-+]\d$/.test(w)&&(w=w.slice(0,-1)+"0"+w.slice(-1))):102!=i&&70!=i||(w=n.toFixed(y),0===n&&jc(n)&&(w="-"+w)),f=w.split("e"),v&&!h)for(;1y++;)f[0]+="0";w=f[0]+(1n?"-":"")+"inf",d=p;for(;w.lengthi&&(w=w.toUpperCase()),w.split("").forEach(function(e){s.push(e.charCodeAt(0))});break;case"s":if(d=(u=r("i8*"))?ic(u):6,v&&(d=Math.min(d,g)),!c)for(;d>2]=s.length;break;case"%":s.push(n);break;default:for(h=f;h>12<<12,nc.ia=l,w(ua),nc.hb=ua,ua=function(){wa("cannot dynamically allocate, sbrk now has control")});var t=z;return 0!=e&&nc.hb(e),t}function U(){return B[U.m>>2]}function oc(){return!!oc.ta}function pc(e){var t=p;try{e==__ZTIi&&(t=l)}catch(e){}try{e==__ZTIj&&(t=l)}catch(e){}try{e==__ZTIl&&(t=l)}catch(e){}try{e==__ZTIm&&(t=l)}catch(e){}try{e==__ZTIx&&(t=l)}catch(e){}try{e==__ZTIy&&(t=l)}catch(e){}try{e==__ZTIf&&(t=l)}catch(e){}try{e==__ZTId&&(t=l)}catch(e){}try{e==__ZTIe&&(t=l)}catch(e){}try{e==__ZTIc&&(t=l)}catch(e){}try{e==__ZTIa&&(t=l)}catch(e){}try{e==__ZTIh&&(t=l)}catch(e){}try{e==__ZTIs&&(t=l)}catch(e){}try{e==__ZTIt&&(t=l)}catch(e){}return t}function qc(e,t,r){if(0==r)return p;if(0==t||t==e)return l;switch(pc(t)?t:B[B[t>>2]-8>>2]){case 0:return 0==B[B[e>>2]-8>>2]?qc(B[e+8>>2],B[t+8>>2],r):p;case 1:return p;case 2:return qc(e,B[t+8>>2],r);default:return p}}function rc(e,t,r){if(!rc.sb){try{B[__ZTVN10__cxxabiv119__pointer_type_infoE>>2]=0}catch(e){}try{B[pb>>2]=1}catch(e){}try{B[ob>>2]=2}catch(e){}rc.sb=l}B[U.m>>2]=e,B[U.m+4>>2]=t,B[U.m+8>>2]=r,"uncaught_exception"in oc?oc.ta++:oc.ta=1,g(e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.")}function sc(e){try{return tc(e)}catch(e){}}function uc(){if(uc.Bb)uc.Bb=p;else{V.setThrew(0),B[U.m+4>>2]=0;var e=B[U.m>>2],t=B[U.m+8>>2];t&&(na("vi",t,[e]),B[U.m+8>>2]=0),e&&(sc(e),B[U.m>>2]=0)}}function wc(e){var t,r;wc.ia?(r=B[vc>>2],t=B[r>>2]):(wc.ia=l,W.USER="root",W.PATH="/",W.PWD="/",W.HOME="/home/emscripten",W.LANG="en_US.UTF-8",W._="./this.program",t=F(1024,"i8",E),r=F(256,"i8*",E),B[r>>2]=t,B[vc>>2]=r);var n,i=[],a=0;for(n in e)if("string"==typeof e[n]){var o=n+"="+e[n];i.push(o),a+=o.length}for(1024>2]=t,t+=o.length+1}B[r+4*i.length>>2]=0}function xc(e){return 0===e?0:(e=Fa(e),W.hasOwnProperty(e)?(xc.J&&tc(xc.J),xc.J=F(J(W[e]),"i8",Ka),xc.J):0)}function yc(e,t,r){if(e in ub){if(ub[e].length>r-1)return M(N.ab);for(e=ub[e],r=0;r>2],B[SDL.screen+0*ma>>2]=8388608|e),Kc()}function Mc(){var e=s.canvas;e.width=this.Ib,e.height=this.Hb,"undefined"!=typeof SDL&&(e=Qa[SDL.screen+0*ma>>2],B[SDL.screen+0*ma>>2]=-8388609&e),Kc()}function X(e,t){e!=m&&("number"==typeof e?this.p(e):t==m&&"string"!=typeof e?this.k(e,256):this.k(e,t))}function Yc(){return new X(m)}function Zc(e,t){var r=$c[e.charCodeAt(t)];return r==m?-1:r}function ad(e){var t=Yc();return t.D(e),t}function Y(e,t){this.h=0|e,this.j=0|t}function lb(e){function t(){if(ab||(ab=l,Va(Xa)),Va(Ya),gb=l,s._main&&kb&&s.callMain(e),s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)cb(s.postRun.shift());Va($a)}if(e=e||s.arguments,0>1];case"i32":case"i64":return B[e>>2];case"float":return Ia[e>>2];case"double":return Ja[e>>3];default:wa("invalid type for setValue: "+t)}return m};var Ka=0,La=1,E=2,Na=4;s.ALLOC_NORMAL=Ka,s.ALLOC_STACK=La,s.ALLOC_STATIC=E,s.ALLOC_DYNAMIC=3,s.ALLOC_NONE=Na,s.allocate=F,s.Pointer_stringify=Fa;var A,G,Ha,Pa,B,Qa,Ia,Ja,Ra=0,sa=0,Sa=0,u=0,Ta=0,Ua=0,z=0,va=s.TOTAL_MEMORY||33554432;w(!!(Int32Array&&Float64Array&&new Int32Array(1).subarray&&new Int32Array(1).set),"Cannot fallback to non-typed array case: Code is too specialized");var I=new ArrayBuffer(va);A=new Int8Array(I),Ha=new Int16Array(I),B=new Int32Array(I),G=new Uint8Array(I),Pa=new Uint16Array(I),Qa=new Uint32Array(I),Ia=new Float32Array(I),Ja=new Float64Array(I),B[0]=255,w(255===G[0]&&0===G[3],"Typed arrays 2 must be run on a little-endian system"),s.HEAP=k,s.HEAP8=A,s.HEAP16=Ha,s.HEAP32=B,s.HEAPU8=G,s.HEAPU16=Pa,s.HEAPU32=Qa,s.HEAPF32=Ia,s.HEAPF64=Ja;var Wa=[],Xa=[],Ya=[],Za=[],$a=[],ab=p;s.addOnPreRun=s.Vd=bb,s.addOnInit=s.Sd=function(e){Xa.unshift(e)},s.addOnPreMain=s.Ud=function(e){Ya.unshift(e)},s.addOnExit=s.Rd=function(e){Za.unshift(e)},s.addOnPostRun=s.Td=cb,s.intArrayFromString=J,s.intArrayToString=function(e){for(var t=[],r=0;r>>16)*n+r*(t>>>16)<<16)|0}),Math.ie=Math.imul;var L=0,fb={},gb=p,hb=m;s.addRunDependency=ib,s.removeRunDependency=jb,s.preloadedImages={},s.preloadedAudios={},Ra=8,sa=Ra+1312,Xa.push({V:function(){mb()}});var nb,ob,pb;nb=nb=F([0,0,0,0,0,0,0,0],"i8",E),ob=ob=F([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",E),pb=pb=F([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",E),F([111,112,116,105,111,110,32,114,101,113,117,105,114,101,115,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,115,0,0,0,0,0,0,0,111,112,116,105,111,110,32,114,101,113,117,105,114,101,115,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,99,0,0,0,0,0,0,0,0,0,0,0,0,0,36,64,0,0,0,0,0,0,89,64,0,0,0,0,0,136,195,64,0,0,0,0,132,215,151,65,0,128,224,55,121,195,65,67,23,110,5,181,181,184,147,70,245,249,63,233,3,79,56,77,50,29,48,249,72,119,130,90,60,191,115,127,221,79,21,117,56,3,0,0,0,0,0,0,63,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255,0,0,0,0,111,112,116,105,111,110,32,100,111,101,115,110,39,116,32,116,97,107,101,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,46,42,115,0,117,110,107,110,111,119,110,32,111,112,116,105,111,110,32,45,45,32,37,115,0,0,0,0,117,110,107,110,111,119,110,32,111,112,116,105,111,110,32,45,45,32,37,99,0,0,0,0,255,255,255,255,0,0,0,0,97,109,98,105,103,117,111,117,115,32,111,112,116,105,111,110,32,45,45,32,37,46,42,115,0,0,0,0,0,0,0,0,37,115,58,32,0,0,0,0,80,79,83,73,88,76,89,95,67,79,82,82,69,67,84,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,0,37,115,58,32,0,0,0,0,37,115,10,0,0,0,0,0,37,115,10,0,0,0,0,0,105,110,32,117,115,101,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,37,115,58,32,0,0,0,0,37,115,58,32,0,0,0,0,98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0,0,0,0,58,32,0,0,0,0,0,0,58,32,0,0,0,0,0,0,115,121,115,116,101,109,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,109,97,120,32,115,121,115,116,101,109,32,98,121,116,101,115,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,0,0,0,0,176,2,0,0,6,0,0,0,10,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,2,0,0,6,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,116,57,101,120,99,101,112,116,105,111,110,0,0,0,0,83,116,57,98,97,100,95,97,108,108,111,99,0,0,0,0,83,116,50,48,98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0,0,0,0,0,0,0,0,0,0,0,0,104,2,0,0,0,0,0,0,120,2,0,0,168,2,0,0,0,0,0,0,0,0,0,0,136,2,0,0,176,2,0,0,0,0,0,0,128,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,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],"i8",Na,8);var qb=xa(F(12,"i8",E),8);w(0==qb%8);var rb=0;s._memcpy=sb,s._memset=tb;var N={L:1,ca:2,Bd:3,sc:4,I:5,za:6,Jb:7,Sc:8,$:9,Zb:10,ua:11,Ld:11,$a:12,Ya:13,kc:14,ed:15,Wb:16,va:17,Md:18,wa:19,gd:20,aa:21,A:22,Mc:23,Za:24,ld:25,Id:26,lc:27,ad:28,da:29,yd:30,Fc:31,rd:32,hc:33,ab:34,Wc:35,pc:36,$b:37,vc:38,wc:39,xc:40,Ec:41,Jd:42,Qc:43,uc:44,ec:45,Tc:46,Pb:50,Sb:51,Nd:52,Oc:53,Tb:54,Ub:55,fc:56,Vb:57,cd:60,Rc:61,Fd:62,bd:63,Xc:64,Yc:65,xd:66,Uc:67,Mb:68,Cd:69,ac:70,td:71,Hc:74,yc:75,ic:76,Rb:77,mc:79,md:80,Qb:81,wd:82,zc:83,Ac:84,Dc:85,Cc:86,Bc:87,dd:88,Nc:89,ya:90,Ic:91,ba:92,nd:95,qd:96,dc:104,Pc:105,Nb:106,vd:107,jd:108,Zc:109,zd:110,cc:111,Kb:112,bc:113,Lc:114,Jc:115,Gd:116,nc:117,oc:118,rc:119,Ob:120,gc:121,Gc:122,ud:123,Ad:124,Lb:125,Kc:126,tc:127,fd:128,Hd:129,sd:130,Kd:131,jc:132,Dd:133,kd:134,Vc:135,$c:136,Yb:137,qc:138,od:139,Xb:140,hd:141,pd:142,Ed:143},ub={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"No message of desired type",36:"Identifier removed",37:"Channel number out of range",38:"Level 2 not synchronized",39:"Level 3 halted",40:"Level 3 reset",41:"Link number out of range",42:"Protocol driver not attached",43:"No CSI structure available",44:"Level 2 halted",45:"Deadlock condition",46:"No record locks available",50:"Invalid exchange",51:"Invalid request descriptor",52:"Exchange full",53:"No anode",54:"Invalid request code",55:"Invalid slot",56:"File locking deadlock error",57:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",74:"Multihop attempted",75:"Inode is remote (not really error)",76:"Cross mount point (not really error)",77:"Trying to read unreadable message",79:"Inappropriate file type or format",80:"Given log. name not unique",81:"f.d. invalid for this operation",82:"Remote address changed",83:"Can\t access a needed shared lib",84:"Accessing a corrupted shared lib",85:".lib section in a.out corrupted",86:"Attempting to link in too many libs",87:"Attempting to exec a shared library",88:"Function not implemented",89:"No more files",90:"Directory not empty",91:"File or path name too long",92:"Too many symbolic links",95:"Operation not supported on transport endpoint",96:"Protocol family not supported",104:"Connection reset by peer",105:"No buffer space available",106:"Address family not supported by protocol family",107:"Protocol wrong type for socket",108:"Socket operation on non-socket",109:"Protocol not available",110:"Can't send after socket shutdown",111:"Connection refused",112:"Address already in use",113:"Connection aborted",114:"Network is unreachable",115:"Network interface is not configured",116:"Connection timed out",117:"Host is down",118:"Host is unreachable",119:"Connection already in progress",120:"Socket already connected",121:"Destination address required",122:"Message too long",123:"Unknown protocol",124:"Socket type not supported",125:"Address not available",126:"ENETRESET",127:"Socket is already connected",128:"Socket is not connected",129:"TOOMANYREFS",130:"EPROCLIM",131:"EUSERS",132:"EDQUOT",133:"ESTALE",134:"Not supported",135:"No medium (in tape drive)",136:"No such host or network path",137:"Filename exists with different case",138:"EILSEQ",139:"Value too large for defined data type",140:"Operation canceled",141:"State not recoverable",142:"Previous owner died",143:"Streams pipe error"},Lb=[],Ob={open:function(e){Pb||(Pb=new pa);var t=Lb[e.d.X];t||g(new Q(N.wa)),e.q=t,e.seekable=p},close:function(e){e.q.H.length&&e.q.O.W(e.q,10)},Q:function(e,t,r,n){(!e.q||!e.q.O.Na)&&g(new Q(N.za));for(var i=0,a=0;ar.length;)r.push(0)}},tb:function(){g(new Q(N.ca))},Ta:function(e,t,r,n){return T.ka(e,t,r,n)},rename:function(e,t,r){if(16384==(61440&e.mode)){var n;try{n=Sb(t,r)}catch(e){}if(n)for(var i in n.g)g(new Q(N.ya))}delete e.parent.g[e.name],e.name=r,t.g[r]=e},ze:function(e,t){delete e.g[t]},ve:function(e,t){var r,n=Sb(e,t);for(r in n.g)g(new Q(N.ya));delete e.g[t]},Wa:function(e,t,r){return e=T.ka(e,t,41471,0),e.link=r,e},Va:function(e){return 40960!=(61440&e.mode)&&g(new Q(N.A)),e.link}},e:{open:function(e){if(16384==(61440&e.d.mode)){var t,r=[".",".."];for(t in e.d.g)e.d.g.hasOwnProperty(t)&&r.push(t);e.lb=r}},Q:function(e,t,r,n,i){if(e=e.d.g,n=Math.min(e.length-i,n),e.subarray)t.set(e.subarray(i,i+n),r);else for(var a=0;at&&g(new Q(N.A)),e.Gb=[],e.position=t},ue:function(e){return e.lb},Wd:function(e,t,r){for(e=e.d.g,t+=r;t>e.length;)e.push(0)},ne:function(e,t,r,n,i,a,o){return 32768!=(61440&e.d.mode)&&g(new Q(N.wa)),e=e.d.g,2&o?((0>2]=0;var Vb=Qb(m,"/",16895,0),Rc=T,Sc={type:Rc,se:{},Ua:"/",root:m},Tc;Tc=O("/",{N:p});var Uc=Rc.z(Sc);Uc.z=Sc,Sc.root=Uc,Tc&&(Tc.d.z=Sc,Tc.d.ub=l,Vb=Sc.root),zb("/tmp",511),zb("/dev",511),Nb[259]={e:{Q:function(){return 0},write:function(){return 0}}},Ab("/dev/null",438,259),Mb(1280,{Na:function(e){if(!e.input.length){var t=m;if(ca){if(process.Eb.be)return;t=process.Eb.Q()}else"undefined"!=typeof window&&"function"==typeof window.prompt?(t=window.prompt("Input: "))!==m&&(t+="\n"):"function"==typeof readline&&(t=readline())!==m&&(t+="\n");if(!t)return m;e.input=J(t,l)}return e.input.shift()},W:function(e,t){t===m||10===t?(s.print(e.H.join("")),e.H=[]):e.H.push(Pb.oa(t))}}),Mb(1536,{W:function(e,t){t===m||10===t?(s.printErr(e.H.join("")),e.H=[]):e.H.push(Pb.oa(t))}}),Ab("/dev/tty",438,1280),Ab("/dev/tty1",438,1536),zb("/dev/shm",511),zb("/dev/shm/tmp",511),Xa.unshift({V:function(){if(!s.noFSInit&&!bc){w(!bc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),bc=l,s.stdin=s.stdin,s.stdout=s.stdout,s.stderr=s.stderr,s.stdin?ec("/dev","stdin",s.stdin):Bb("/dev/tty","/dev/stdin"),s.stdout?ec("/dev","stdout",m,s.stdout):Bb("/dev/tty","/dev/stdout"),s.stderr?ec("/dev","stderr",m,s.stderr):Bb("/dev/tty1","/dev/stderr");var e=Db("/dev/stdin","r");B[Tb>>2]=e.s,w(1===e.s,"invalid handle for stdin ("+e.s+")"),e=Db("/dev/stdout","w"),B[Ub>>2]=e.s,w(2===e.s,"invalid handle for stdout ("+e.s+")"),e=Db("/dev/stderr","w"),B[nb>>2]=e.s,w(3===e.s,"invalid handle for stderr ("+e.s+")")}}}),Ya.push({V:function(){Yb=p}}),Za.push({V:function(){bc=p;for(var e=0;e>a-6&63,a=a-6,r=r+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f];2==a?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&n)<<4],r+="=="):4==a&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&n)<<2],r+="="),u.src="data:audio/x-"+t.substr(-3)+";base64,"+r,i(u)}},u.src=f,setTimeout(function(){za||i(u)},1e4)}});var h=s.canvas;h.qa=h.requestPointerLock||h.mozRequestPointerLock||h.webkitRequestPointerLock,h.La=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||aa(),h.La=h.La.bind(document),document.addEventListener("pointerlockchange",u,p),document.addEventListener("mozpointerlockchange",u,p),document.addEventListener("webkitpointerlockchange",u,p),s.elementPointerLock&&h.addEventListener("click",function(e){!Ec&&h.qa&&(h.qa(),e.preventDefault())},p)}var d,b=S.apply(m,[e,t]);if("/"==b[0]&&(b=b.substr(1)),d=b,ib("cp "+d),"string"==typeof r){var v=o,y=function(){v?v():g('Loading data file "'+r+'" failed.')},_=new XMLHttpRequest;_.open("GET",r,l),_.responseType="arraybuffer",_.onload=function(){if(200==_.status||0==_.status&&_.response){var e=_.response;w(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),e=new Uint8Array(e),c(e),jb("al "+r)}else y()},_.onerror=y,_.send(m),ib("al "+r)}else c(r)},s.FS_createLazyFile=function(e,t,r,n,i){var a,o;"undefined"!=typeof XMLHttpRequest?(ea||g("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"),a=function(){this.ma=p,this.T=[]},a.prototype.get=function(e){if(!(e>this.length-1||0>e)){var t=e%this.S;return this.pb(Math.floor(e/this.S))[t]}},a.prototype.Cb=function(e){this.pb=e},a.prototype.Fa=function(){var e=new XMLHttpRequest;e.open("HEAD",r,p),e.send(m),200<=e.status&&300>e.status||304===e.status||g(Error("Couldn't load "+r+". Status: "+e.status));var t,n=Number(e.getResponseHeader("Content-length")),i=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(i=n);var a=this;a.Cb(function(e){var t=e*i,o=(e+1)*i-1,o=Math.min(o,n-1);if(void 0===a.T[e]){var s=a.T;t>o&&g(Error("invalid range ("+t+", "+o+") or no bytes requested!")),o>n-1&&g(Error("only "+n+" bytes available! programmer error!"));var f=new XMLHttpRequest;f.open("GET",r,p),n!==i&&f.setRequestHeader("Range","bytes="+t+"-"+o),"undefined"!=typeof Uint8Array&&(f.responseType="arraybuffer"),f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined"),f.send(m),200<=f.status&&300>f.status||304===f.status||g(Error("Couldn't load "+r+". Status: "+f.status)),t=f.response!==k?new Uint8Array(f.response||[]):J(f.responseText||"",l),s[e]=t}return void 0===a.T[e]&&g(Error("doXHR failed!")),a.T[e]}),this.gb=n,this.fb=i,this.ma=l},a=new a,Object.defineProperty(a,"length",{get:function(){return this.ma||this.Fa(),this.gb}}),Object.defineProperty(a,"chunkSize",{get:function(){return this.ma||this.Fa(),this.fb}}),o=k):(o=r,a=k);var f,e=S("string"==typeof e?e:ac(e),t);f=yb(e,cc(n,i)),a?f.g=a:o&&(f.g=m,f.url=o);var u={};return Object.keys(f.e).forEach(function(e){var t=f.e[e];u[e]=function(){var e;if(f.ke||f.le||f.link||f.g)e=l;else{if(e=l,"undefined"!=typeof XMLHttpRequest&&g(Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")),s.read)try{f.g=J(s.read(f.url),l)}catch(t){e=p}else g(Error("Cannot load without read() or XMLHttpRequest."));e||M(N.I)}return e||g(new Q(N.I)),t.apply(m,arguments)}}),u.Q=function(e,t,r,n,i){if(e=e.d.g,n=Math.min(e.length-i,n),e.slice)for(var a=0;a>3<<3;return t|0}function at(){return h|0}function ot(e){e=e|0;h=e}function st(e,t){e=e|0;t=t|0;if((k|0)==0){k=e;x=t}}function ft(e){e=e|0;n[d]=n[e];n[d+1|0]=n[e+1|0];n[d+2|0]=n[e+2|0];n[d+3|0]=n[e+3|0]}function ut(e){e=e|0;n[d]=n[e];n[d+1|0]=n[e+1|0];n[d+2|0]=n[e+2|0];n[d+3|0]=n[e+3|0];n[d+4|0]=n[e+4|0];n[d+5|0]=n[e+5|0];n[d+6|0]=n[e+6|0];n[d+7|0]=n[e+7|0]}function ct(e){e=e|0;j=e}function ht(e){e=e|0;z=e}function lt(e){e=e|0;L=e}function dt(e){e=e|0;F=e}function pt(e){e=e|0;H=e}function bt(e){e=e|0;U=e}function vt(e){e=e|0;D=e}function mt(e){e=e|0;q=e}function gt(e){e=e|0;K=e}function yt(e){e=e|0;Y=e}function wt(){a[170]=y+8;a[172]=g+8;a[176]=g+8}function _t(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)==0){return}else{i=0}do{n[e+i|0]=n[t+i|0]|0;i=i+1|0}while(i>>>0>>0);return}function St(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,a=0;if((r|0)==0){return}else{i=0}do{a=e+i|0;n[a]=n[a]^n[t+i|0];i=i+1|0}while(i>>>0>>0);return}function kt(e){e=e|0;var t=0,r=0,n=0,i=0;t=o[e+1|0]|0;r=o[e+2|0]|0;n=o[e+3|0]|0;i=rn(t<<8|0>>>24|(o[e]|0)|(r<<16|0>>>16)|(n<<24|0>>>8)|(0<<8|0>>>24),0<<8|t>>>24|(0<<16|r>>>16)|(0<<24|n>>>8)|(o[e+4|0]|0)|((o[e+5|0]|0)<<8|0>>>24),0<<16|0>>>16,(o[e+6|0]|0)<<16|0>>>16)|0;n=rn(i,j,0<<24|0>>>8,(o[e+7|0]|0)<<24|0>>>8)|0;return(j=j,n)|0}function xt(e){e=e|0;return(o[e+1|0]|0)<<8|(o[e]|0)|(o[e+2|0]|0)<<16|(o[e+3|0]|0)<<24|0}function At(e,t){e=e|0;t=t|0;n[e]=t&255;n[e+1|0]=t>>>8&255;n[e+2|0]=t>>>16&255;n[e+3|0]=t>>>24&255;return}function Mt(e){e=e|0;a[e+36>>2]=0;a[e+32>>2]=0;a[e>>2]=1779033703;a[e+4>>2]=-1150833019;a[e+8>>2]=1013904242;a[e+12>>2]=-1521486534;a[e+16>>2]=1359893119;a[e+20>>2]=-1694144372;a[e+24>>2]=528734635;a[e+28>>2]=1541459225;return}function Et(e,t,r,n,i,o,s,f,u,c){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;o=o|0;s=s|0;f=f|0;u=u|0;c=c|0;var h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0;h=dn(f,0,s,0)|0;l=j;d=0;if(l>>>0>d>>>0|l>>>0==d>>>0&h>>>0>1073741823>>>0){a[($e()|0)>>2]=27;p=-1;return p|0}h=rn(i,o,-1,-1)|0;if((h&i|0)!=0|(j&o|0)!=0|(i|0)==0&(o|0)==0){a[($e()|0)>>2]=22;p=-1;return p|0}do{if(!((33554431/(f>>>0)|0)>>>0>>0|s>>>0>16777215)){h=0;if(h>>>0>>0|h>>>0==o>>>0&(33554431/(s>>>0)|0)>>>0>>0){break}h=s<<7;d=Kt(oe(h,f)|0)|0;if((d|0)==0){p=-1;return p|0}l=Kt(s<<8)|0;do{if((l|0)!=0){b=dn(h,0,i,o)|0;v=Kt(b)|0;if((v|0)==0){Yt(l);break}b=oe(f<<7,s)|0;Dt(e,t,r,n,1,0,d,b);if((f|0)!=0){m=s<<7;g=0;do{It(d+(oe(m,g)|0)|0,s,i,o,v,l);g=g+1|0}while(g>>>0>>0)}Dt(e,t,d,b,1,0,u,c);Yt(v);Yt(l);Yt(d);p=0;return p|0}}while(0);Yt(d);p=-1;return p|0}}while(0);a[($e()|0)>>2]=12;p=-1;return p|0}function It(e,t,r,n,i,a){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;a=a|0;var o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0;o=t<<7;s=a+o|0;_t(a,e,o);if((r|0)==0&(n|0)==0){_t(e,a,o);return}f=o;u=0;c=0;h=0;do{l=dn(h,c,f,u)|0;_t(i+l|0,a,o);Tt(a,s,t);h=rn(h,c,1,0)|0;c=j}while(c>>>0>>0|c>>>0==n>>>0&h>>>0>>0);if((r|0)==0&(n|0)==0){_t(e,a,o);return}h=rn(r,n,-1,-1)|0;c=j;u=o;f=0;l=0;d=0;do{p=Pt(a,t)|0;b=dn(p&h,j&c,u,f)|0;St(a,i+b|0,o);Tt(a,s,t);d=rn(d,l,1,0)|0;l=j}while(l>>>0>>0|l>>>0==n>>>0&d>>>0>>0);_t(e,a,o);return}function Tt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,a=0,o=0,s=0,f=0,u=0;n=h;h=h+64|0;i=n|0;a=r<<1;_t(i,e+((r<<7)-64)|0,64);if((a|0)!=0){o=0;do{s=o<<6;St(i,e+s|0,64);Rt(i);_t(t+s|0,i,64);o=o+1|0}while(o>>>0>>0)}if((r|0)==0){h=n;return}else{f=0}do{_t(e+(f<<6)|0,t+(f<<7)|0,64);f=f+1|0}while(f>>>0>>0);if((r|0)==0){h=n;return}else{u=0}do{_t(e+(u+r<<6)|0,t+(u<<7|64)|0,64);u=u+1|0}while(u>>>0>>0);h=n;return}function Pt(e,t){e=e|0;t=t|0;var r=0;r=kt(e+((t<<7)-64)|0)|0;return(j=j,r)|0}function Rt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,F=0,H=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0;t=h;h=h+128|0;r=t|0;n=t+64|0;i=0;do{a[r+(i<<2)>>2]=xt(e+(i<<2)|0)|0;i=i+1|0}while(i>>>0<16);i=r;o=n;Jr(o|0,i|0,64)|0;i=n|0;o=n+48|0;s=n+16|0;f=n+32|0;u=n+20|0;c=n+4|0;l=n+36|0;d=n+52|0;p=n+40|0;b=n+24|0;v=n+56|0;m=n+8|0;g=n+60|0;y=n+44|0;w=n+12|0;_=n+28|0;S=0;k=a[i>>2]|0;x=a[o>>2]|0;A=a[s>>2]|0;M=a[f>>2]|0;E=a[u>>2]|0;I=a[c>>2]|0;T=a[l>>2]|0;P=a[d>>2]|0;R=a[p>>2]|0;B=a[b>>2]|0;C=a[v>>2]|0;O=a[m>>2]|0;N=a[g>>2]|0;j=a[y>>2]|0;z=a[w>>2]|0;L=a[_>>2]|0;do{F=x+k|0;H=(F<<7|F>>>25)^A;F=H+k|0;U=(F<<9|F>>>23)^M;F=U+H|0;D=(F<<13|F>>>19)^x;F=D+U|0;q=(F<<18|F>>>14)^k;F=I+E|0;K=(F<<7|F>>>25)^T;F=K+E|0;Y=(F<<9|F>>>23)^P;F=Y+K|0;V=(F<<13|F>>>19)^I;F=V+Y|0;W=(F<<18|F>>>14)^E;F=B+R|0;X=(F<<7|F>>>25)^C;F=X+R|0;Z=(F<<9|F>>>23)^O;F=Z+X|0;G=(F<<13|F>>>19)^B;F=G+Z|0;Q=(F<<18|F>>>14)^R;F=j+N|0;$=(F<<7|F>>>25)^z;F=$+N|0;J=(F<<9|F>>>23)^L;F=J+$|0;ee=(F<<13|F>>>19)^j;F=ee+J|0;te=(F<<18|F>>>14)^N;F=$+q|0;I=(F<<7|F>>>25)^V;V=I+q|0;O=(V<<9|V>>>23)^Z;Z=O+I|0;z=(Z<<13|Z>>>19)^$;$=z+O|0;k=($<<18|$>>>14)^q;q=H+W|0;B=(q<<7|q>>>25)^G;G=B+W|0;L=(G<<9|G>>>23)^J;J=L+B|0;A=(J<<13|J>>>19)^H;H=A+L|0;E=(H<<18|H>>>14)^W;W=K+Q|0;j=(W<<7|W>>>25)^ee;ee=j+Q|0;M=(ee<<9|ee>>>23)^U;U=M+j|0;T=(U<<13|U>>>19)^K;K=T+M|0;R=(K<<18|K>>>14)^Q;Q=X+te|0;x=(Q<<7|Q>>>25)^D;D=x+te|0;P=(D<<9|D>>>23)^Y;Y=P+x|0;C=(Y<<13|Y>>>19)^X;X=C+P|0;N=(X<<18|X>>>14)^te;S=S+2|0}while(S>>>0<8);a[i>>2]=k;a[o>>2]=x;a[s>>2]=A;a[f>>2]=M;a[u>>2]=E;a[c>>2]=I;a[l>>2]=T;a[d>>2]=P;a[p>>2]=R;a[b>>2]=B;a[v>>2]=C;a[m>>2]=O;a[g>>2]=N;a[y>>2]=j;a[w>>2]=z;a[_>>2]=L;L=r|0;a[L>>2]=(a[L>>2]|0)+(a[n>>2]|0);L=r+4|0;a[L>>2]=(a[L>>2]|0)+(a[n+4>>2]|0);L=r+8|0;a[L>>2]=(a[L>>2]|0)+(a[n+8>>2]|0);L=r+12|0;a[L>>2]=(a[L>>2]|0)+(a[n+12>>2]|0);L=r+16|0;a[L>>2]=(a[L>>2]|0)+(a[n+16>>2]|0);L=r+20|0;a[L>>2]=(a[L>>2]|0)+(a[n+20>>2]|0);L=r+24|0;a[L>>2]=(a[L>>2]|0)+(a[n+24>>2]|0);L=r+28|0;a[L>>2]=(a[L>>2]|0)+(a[n+28>>2]|0);L=r+32|0;a[L>>2]=(a[L>>2]|0)+(a[n+32>>2]|0);L=r+36|0;a[L>>2]=(a[L>>2]|0)+(a[n+36>>2]|0);L=r+40|0;a[L>>2]=(a[L>>2]|0)+(a[n+40>>2]|0);L=r+44|0;a[L>>2]=(a[L>>2]|0)+(a[n+44>>2]|0);L=r+48|0;a[L>>2]=(a[L>>2]|0)+(a[n+48>>2]|0);L=r+52|0;a[L>>2]=(a[L>>2]|0)+(a[n+52>>2]|0);L=r+56|0;a[L>>2]=(a[L>>2]|0)+(a[n+56>>2]|0);L=r+60|0;a[L>>2]=(a[L>>2]|0)+(a[n+60>>2]|0);n=0;do{At(e+(n<<2)|0,a[r+(n<<2)>>2]|0);n=n+1|0}while(n>>>0<16);h=t;return}function Bt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,o=0,s=0,f=0,u=0,c=0;n=e+32|0;i=e+36|0;o=a[i>>2]|0;s=o>>>3&63;f=De(o|0,r<<3|0)|0;a[i>>2]=f;if(j){f=n|0;a[f>>2]=(a[f>>2]|0)+1}f=n|0;a[f>>2]=(a[f>>2]|0)+(r>>>29);f=64-s|0;n=e+40+s|0;if(f>>>0>r>>>0){Jr(n|0,t|0,r)|0;return}Jr(n|0,t|0,f)|0;n=e|0;s=e+40|0;Ct(n,s);e=t+f|0;t=r-f|0;if(t>>>0>63){f=t;r=e;while(1){Ct(n,r);i=r+64|0;o=f-64|0;if(o>>>0>63){f=o;r=i}else{u=o;c=i;break}}}else{u=t;c=e}Jr(s|0,c|0,u)|0;return}function Ct(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0;r=h;h=h+288|0;n=r|0;i=r+256|0;o=n|0;qt(o,t);t=16;do{s=a[n+(t-2<<2)>>2]|0;f=a[n+(t-15<<2)>>2]|0;a[n+(t<<2)>>2]=(a[n+(t-16<<2)>>2]|0)+(a[n+(t-7<<2)>>2]|0)+((s>>>19|s<<13)^s>>>10^(s>>>17|s<<15))+((f>>>18|f<<14)^f>>>3^(f>>>7|f<<25));t=t+1|0}while((t|0)<64);t=i;f=e;Jr(t|0,f|0,32)|0;f=i+28|0;t=i+16|0;s=a[t>>2]|0;u=i+20|0;c=i+24|0;l=a[c>>2]|0;d=(a[f>>2]|0)+1116352408+(a[o>>2]|0)+((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((l^a[u>>2])&s^l)|0;l=i|0;s=a[l>>2]|0;o=i+4|0;p=a[o>>2]|0;b=i+8|0;v=a[b>>2]|0;m=i+12|0;a[m>>2]=(a[m>>2]|0)+d;g=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+d+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)+1899447441+(a[n+4>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)-1245643825+(a[n+8>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)-373957723+(a[n+12>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)+961987163+(a[n+16>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)+1508970993+(a[n+20>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)-1841331548+(a[n+24>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)-1424204075+(a[n+28>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)-670586216+(a[n+32>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+310598401+(a[n+36>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)+607225278+(a[n+40>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)+1426881987+(a[n+44>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)+1925078388+(a[n+48>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)-2132889090+(a[n+52>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-1680079193+(a[n+56>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;p=a[u>>2]|0;v=a[f>>2]|0;d=(a[l>>2]|0)-1046744716+(a[n+60>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[l>>2]=g;v=a[t>>2]|0;p=a[c>>2]|0;s=(a[f>>2]|0)-459576895+(a[n+64>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[f>>2]=d;p=a[m>>2]|0;v=a[u>>2]|0;g=(a[c>>2]|0)-272742522+(a[n+68>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[c>>2]=s;v=a[b>>2]|0;p=a[t>>2]|0;d=(a[u>>2]|0)+264347078+(a[n+72>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[u>>2]=g;p=a[o>>2]|0;v=a[m>>2]|0;s=(a[t>>2]|0)+604807628+(a[n+76>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[t>>2]=d;v=a[l>>2]|0;p=a[b>>2]|0;g=(a[m>>2]|0)+770255983+(a[n+80>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[m>>2]=s;p=a[f>>2]|0;v=a[o>>2]|0;d=(a[b>>2]|0)+1249150122+(a[n+84>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[b>>2]=g;v=a[c>>2]|0;p=a[l>>2]|0;s=(a[o>>2]|0)+1555081692+(a[n+88>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[o>>2]=d;p=a[u>>2]|0;v=a[f>>2]|0;g=(a[l>>2]|0)+1996064986+(a[n+92>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[l>>2]=s;v=a[t>>2]|0;p=a[c>>2]|0;d=(a[f>>2]|0)-1740746414+(a[n+96>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)-1473132947+(a[n+100>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)-1341970488+(a[n+104>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)-1084653625+(a[n+108>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)-958395405+(a[n+112>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)-710438585+(a[n+116>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)+113926993+(a[n+120>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)+338241895+(a[n+124>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)+666307205+(a[n+128>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+773529912+(a[n+132>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)+1294757372+(a[n+136>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)+1396182291+(a[n+140>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)+1695183700+(a[n+144>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)+1986661051+(a[n+148>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-2117940946+(a[n+152>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;p=a[u>>2]|0;v=a[f>>2]|0;d=(a[l>>2]|0)-1838011259+(a[n+156>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[l>>2]=g;v=a[t>>2]|0;p=a[c>>2]|0;s=(a[f>>2]|0)-1564481375+(a[n+160>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[f>>2]=d;p=a[m>>2]|0;v=a[u>>2]|0;g=(a[c>>2]|0)-1474664885+(a[n+164>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[c>>2]=s;v=a[b>>2]|0;p=a[t>>2]|0;d=(a[u>>2]|0)-1035236496+(a[n+168>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[u>>2]=g;p=a[o>>2]|0;v=a[m>>2]|0;s=(a[t>>2]|0)-949202525+(a[n+172>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[t>>2]=d;v=a[l>>2]|0;p=a[b>>2]|0;g=(a[m>>2]|0)-778901479+(a[n+176>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[m>>2]=s;p=a[f>>2]|0;v=a[o>>2]|0;d=(a[b>>2]|0)-694614492+(a[n+180>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[b>>2]=g;v=a[c>>2]|0;p=a[l>>2]|0;s=(a[o>>2]|0)-200395387+(a[n+184>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[o>>2]=d;p=a[u>>2]|0;v=a[f>>2]|0;g=(a[l>>2]|0)+275423344+(a[n+188>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[l>>2]=s;v=a[t>>2]|0;p=a[c>>2]|0;d=(a[f>>2]|0)+430227734+(a[n+192>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)+506948616+(a[n+196>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)+659060556+(a[n+200>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)+883997877+(a[n+204>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)+958139571+(a[n+208>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)+1322822218+(a[n+212>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)+1537002063+(a[n+216>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)+1747873779+(a[n+220>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)+1955562222+(a[n+224>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+2024104815+(a[n+228>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)-2067236844+(a[n+232>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)-1933114872+(a[n+236>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)-1866530822+(a[n+240>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)-1538233109+(a[n+244>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-1090935817+(a[n+248>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;o=a[u>>2]|0;u=a[f>>2]|0;f=(a[l>>2]|0)-965641998+(a[n+252>>2]|0)+((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+((u^a[c>>2])&o^u)|0;u=a[b>>2]|0;b=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+f;t=f+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((b|u)&s|b&u)|0;a[l>>2]=t;a[e>>2]=(a[e>>2]|0)+t;t=e+4|0;a[t>>2]=(a[t>>2]|0)+(a[i+4>>2]|0);t=e+8|0;a[t>>2]=(a[t>>2]|0)+(a[i+8>>2]|0);t=e+12|0;a[t>>2]=(a[t>>2]|0)+(a[i+12>>2]|0);t=e+16|0;a[t>>2]=(a[t>>2]|0)+(a[i+16>>2]|0);t=e+20|0;a[t>>2]=(a[t>>2]|0)+(a[i+20>>2]|0);t=e+24|0;a[t>>2]=(a[t>>2]|0)+(a[i+24>>2]|0);t=e+28|0;a[t>>2]=(a[t>>2]|0)+(a[i+28>>2]|0);h=r;return}function Ot(e,t){e=e|0;t=t|0;n[e+3|0]=t&255;n[e+2|0]=t>>>8&255;n[e+1|0]=t>>>16&255;n[e]=t>>>24&255;return}function Nt(e){e=e|0;return(o[e+2|0]|0)<<8|(o[e+3|0]|0)|(o[e+1|0]|0)<<16|(o[e]|0)<<24|0}function jt(e,t){e=e|0;t=t|0;zt(t);Lt(e,t|0,32);en(t|0,0,104);return}function zt(e){e=e|0;var t=0,r=0,n=0;t=h;h=h+8|0;r=t|0;Lt(r,e+32|0,8);n=(a[e+36>>2]|0)>>>3&63;Bt(e,720,(n>>>0<56?56:120)-n|0);Bt(e,r,8);h=t;return}function Lt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=r>>>2;if((n|0)==0){return}else{i=0}do{Ot(e+(i<<2)|0,a[t+(i<<2)>>2]|0);i=i+1|0}while(i>>>0>>0);return}function Ft(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,a=0,o=0,s=0,f=0,u=0,c=0;i=h;h=h+96|0;a=i|0;if(r>>>0>64){o=e|0;Mt(o);Bt(o,t,r);s=i+64|0;jt(s,o);f=s;u=32}else{f=t;u=r}r=e|0;Mt(r);t=a|0;en(t|0,54,64);if((u|0)!=0){s=0;do{o=a+s|0;n[o]=n[o]^n[f+s|0];s=s+1|0}while(s>>>0>>0)}Bt(r,t,64);r=e+104|0;Mt(r);en(t|0,92,64);if((u|0)==0){Bt(r,t,64);h=i;return}else{c=0}do{e=a+c|0;n[e]=n[e]^n[f+c|0];c=c+1|0}while(c>>>0>>0);Bt(r,t,64);h=i;return}function Ht(e,t,r){e=e|0;t=t|0;r=r|0;Bt(e|0,t,r);return}function Ut(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+32|0;n=r|0;jt(n,t|0);i=t+104|0;Bt(i,n,32);jt(e,i);h=r;return}function Dt(e,t,r,i,a,o,s,f){e=e|0;t=t|0;r=r|0;i=i|0;a=a|0;o=o|0;s=s|0;f=f|0;var u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0;u=h;h=h+488|0;c=u|0;l=u+208|0;d=u+424|0;p=u+456|0;Ft(c,e,t);Ht(c,r,i);if((f|0)==0){h=u;return}i=u+416|0;r=l;b=c;c=d|0;v=p|0;m=0;g=o>>>0>>0|o>>>0==m>>>0&a>>>0<2>>>0;m=0;y=0;do{m=m+1|0;Ot(i,m);Jr(r|0,b|0,208)|0;Ht(l,i,4);Ut(c,l);Jr(v|0,c|0,32)|0;if(!g){w=0;_=2;do{Ft(l,e,t);Ht(l,c,32);Ut(c,l);S=0;do{k=p+S|0;n[k]=n[k]^n[d+S|0];S=S+1|0}while((S|0)<32);_=rn(_,w,1,0)|0;w=j}while(!(w>>>0>o>>>0|w>>>0==o>>>0&_>>>0>a>>>0))}_=f-y|0;w=_>>>0>32?32:_;_=s+y|0;Jr(_|0,v|0,w)|0;y=m<<5}while(y>>>0>>0);h=u;return}function qt(e,t){e=e|0;t=t|0;var r=0;r=0;do{a[e+(r<<2)>>2]=Nt(t+(r<<2)|0)|0;r=r+1|0}while(r>>>0<16);return}function Kt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,F=0,H=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0,re=0,ne=0,ie=0,ae=0,oe=0,se=0,fe=0,ue=0,ce=0,he=0,le=0,de=0,pe=0,be=0,ve=0,me=0,ge=0,ye=0,_e=0,Se=0,xe=0,Ae=0,Me=0,Ee=0,Ie=0,Te=0,Pe=0,Re=0,Be=0,Ce=0,Oe=0;do{if(e>>>0<245){if(e>>>0<11){t=16}else{t=e+11&-8}r=t>>>3;n=a[208]|0;i=n>>>(r>>>0);if((i&3|0)!=0){o=(i&1^1)+r|0;s=o<<1;f=872+(s<<2)|0;u=872+(s+2<<2)|0;s=a[u>>2]|0;c=s+8|0;h=a[c>>2]|0;do{if((f|0)==(h|0)){a[208]=n&~(1<>>0<(a[212]|0)>>>0){ke();return 0}l=h+12|0;if((a[l>>2]|0)==(s|0)){a[l>>2]=f;a[u>>2]=h;break}else{ke();return 0}}}while(0);h=o<<3;a[s+4>>2]=h|3;u=s+(h|4)|0;a[u>>2]=a[u>>2]|1;d=c;return d|0}if(t>>>0<=(a[210]|0)>>>0){p=t;break}if((i|0)!=0){u=2<>>12&16;f=u>>>(h>>>0);u=f>>>5&8;l=f>>>(u>>>0);f=l>>>2&4;b=l>>>(f>>>0);l=b>>>1&2;v=b>>>(l>>>0);b=v>>>1&1;m=(u|h|f|l|b)+(v>>>(b>>>0))|0;b=m<<1;v=872+(b<<2)|0;l=872+(b+2<<2)|0;b=a[l>>2]|0;f=b+8|0;h=a[f>>2]|0;do{if((v|0)==(h|0)){a[208]=n&~(1<>>0<(a[212]|0)>>>0){ke();return 0}u=h+12|0;if((a[u>>2]|0)==(b|0)){a[u>>2]=v;a[l>>2]=h;break}else{ke();return 0}}}while(0);h=m<<3;l=h-t|0;a[b+4>>2]=t|3;v=b;n=v+t|0;a[v+(t|4)>>2]=l|1;a[v+h>>2]=l;h=a[210]|0;if((h|0)!=0){v=a[213]|0;r=h>>>3;h=r<<1;i=872+(h<<2)|0;c=a[208]|0;s=1<>2]|0;if(o>>>0>=(a[212]|0)>>>0){g=o;y=r;break}ke();return 0}}while(0);a[y>>2]=v;a[g+12>>2]=v;a[v+8>>2]=g;a[v+12>>2]=i}a[210]=l;a[213]=n;d=f;return d|0}h=a[209]|0;if((h|0)==0){p=t;break}s=(h&-h)-1|0;h=s>>>12&16;c=s>>>(h>>>0);s=c>>>5&8;b=c>>>(s>>>0);c=b>>>2&4;m=b>>>(c>>>0);b=m>>>1&2;r=m>>>(b>>>0);m=r>>>1&1;o=a[1136+((s|h|c|b|m)+(r>>>(m>>>0))<<2)>>2]|0;m=o;r=o;b=(a[o+4>>2]&-8)-t|0;while(1){o=a[m+16>>2]|0;if((o|0)==0){c=a[m+20>>2]|0;if((c|0)==0){break}else{w=c}}else{w=o}o=(a[w+4>>2]&-8)-t|0;c=o>>>0>>0;m=w;r=c?w:r;b=c?o:b}m=r;f=a[212]|0;if(m>>>0>>0){ke();return 0}n=m+t|0;l=n;if(m>>>0>=n>>>0){ke();return 0}n=a[r+24>>2]|0;i=a[r+12>>2]|0;do{if((i|0)==(r|0)){v=r+20|0;o=a[v>>2]|0;if((o|0)==0){c=r+16|0;h=a[c>>2]|0;if((h|0)==0){_=0;break}else{S=h;k=c}}else{S=o;k=v}while(1){v=S+20|0;o=a[v>>2]|0;if((o|0)!=0){S=o;k=v;continue}v=S+16|0;o=a[v>>2]|0;if((o|0)==0){break}else{S=o;k=v}}if(k>>>0>>0){ke();return 0}else{a[k>>2]=0;_=S;break}}else{v=a[r+8>>2]|0;if(v>>>0>>0){ke();return 0}o=v+12|0;if((a[o>>2]|0)!=(r|0)){ke();return 0}c=i+8|0;if((a[c>>2]|0)==(r|0)){a[o>>2]=i;a[c>>2]=v;_=i;break}else{ke();return 0}}}while(0);e:do{if((n|0)!=0){i=r+28|0;f=1136+(a[i>>2]<<2)|0;do{if((r|0)==(a[f>>2]|0)){a[f>>2]=_;if((_|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(n>>>0<(a[212]|0)>>>0){ke();return 0}v=n+16|0;if((a[v>>2]|0)==(r|0)){a[v>>2]=_}else{a[n+20>>2]=_}if((_|0)==0){break e}}}while(0);if(_>>>0<(a[212]|0)>>>0){ke();return 0}a[_+24>>2]=n;i=a[r+16>>2]|0;do{if((i|0)!=0){if(i>>>0<(a[212]|0)>>>0){ke();return 0}else{a[_+16>>2]=i;a[i+24>>2]=_;break}}}while(0);i=a[r+20>>2]|0;if((i|0)==0){break}if(i>>>0<(a[212]|0)>>>0){ke();return 0}else{a[_+20>>2]=i;a[i+24>>2]=_;break}}}while(0);if(b>>>0<16){n=b+t|0;a[r+4>>2]=n|3;i=m+(n+4)|0;a[i>>2]=a[i>>2]|1}else{a[r+4>>2]=t|3;a[m+(t|4)>>2]=b|1;a[m+(b+t)>>2]=b;i=a[210]|0;if((i|0)!=0){n=a[213]|0;f=i>>>3;i=f<<1;v=872+(i<<2)|0;c=a[208]|0;o=1<>2]|0;if(h>>>0>=(a[212]|0)>>>0){x=h;A=f;break}ke();return 0}}while(0);a[A>>2]=n;a[x+12>>2]=n;a[n+8>>2]=x;a[n+12>>2]=v}a[210]=b;a[213]=l}i=r+8|0;if((i|0)==0){p=t;break}else{d=i}return d|0}else{if(e>>>0>4294967231){p=-1;break}i=e+11|0;o=i&-8;c=a[209]|0;if((c|0)==0){p=o;break}m=-o|0;f=i>>>8;do{if((f|0)==0){M=0}else{if(o>>>0>16777215){M=31;break}i=(f+1048320|0)>>>16&8;h=f<>>16&4;u=h<>>16&2;E=14-(s|i|h)+(u<>>15)|0;M=o>>>((E+7|0)>>>0)&1|E<<1}}while(0);f=a[1136+(M<<2)>>2]|0;e:do{if((f|0)==0){I=0;T=m;P=0}else{if((M|0)==31){R=0}else{R=25-(M>>>1)|0}r=0;l=m;b=f;v=o<>2]&-8;h=E-o|0;if(h>>>0>>0){if((E|0)==(o|0)){I=b;T=h;P=b;break e}else{B=b;C=h}}else{B=r;C=l}h=a[b+20>>2]|0;E=a[b+16+(v>>>31<<2)>>2]|0;u=(h|0)==0|(h|0)==(E|0)?n:h;if((E|0)==0){I=B;T=C;P=u;break}else{r=B;l=C;b=E;v=v<<1;n=u}}}}while(0);if((P|0)==0&(I|0)==0){f=2<>>12&16;n=f>>>(m>>>0);f=n>>>5&8;v=n>>>(f>>>0);n=v>>>2&4;b=v>>>(n>>>0);v=b>>>1&2;l=b>>>(v>>>0);b=l>>>1&1;O=a[1136+((f|m|n|v|b)+(l>>>(b>>>0))<<2)>>2]|0}else{O=P}if((O|0)==0){N=T;j=I}else{b=O;l=T;v=I;while(1){n=(a[b+4>>2]&-8)-o|0;m=n>>>0>>0;f=m?n:l;n=m?b:v;m=a[b+16>>2]|0;if((m|0)!=0){b=m;l=f;v=n;continue}m=a[b+20>>2]|0;if((m|0)==0){N=f;j=n;break}else{b=m;l=f;v=n}}}if((j|0)==0){p=o;break}if(N>>>0>=((a[210]|0)-o|0)>>>0){p=o;break}v=j;l=a[212]|0;if(v>>>0>>0){ke();return 0}b=v+o|0;c=b;if(v>>>0>=b>>>0){ke();return 0}n=a[j+24>>2]|0;f=a[j+12>>2]|0;do{if((f|0)==(j|0)){m=j+20|0;r=a[m>>2]|0;if((r|0)==0){u=j+16|0;E=a[u>>2]|0;if((E|0)==0){z=0;break}else{L=E;F=u}}else{L=r;F=m}while(1){m=L+20|0;r=a[m>>2]|0;if((r|0)!=0){L=r;F=m;continue}m=L+16|0;r=a[m>>2]|0;if((r|0)==0){break}else{L=r;F=m}}if(F>>>0>>0){ke();return 0}else{a[F>>2]=0;z=L;break}}else{m=a[j+8>>2]|0;if(m>>>0>>0){ke();return 0}r=m+12|0;if((a[r>>2]|0)!=(j|0)){ke();return 0}u=f+8|0;if((a[u>>2]|0)==(j|0)){a[r>>2]=f;a[u>>2]=m;z=f;break}else{ke();return 0}}}while(0);e:do{if((n|0)!=0){f=j+28|0;l=1136+(a[f>>2]<<2)|0;do{if((j|0)==(a[l>>2]|0)){a[l>>2]=z;if((z|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(n>>>0<(a[212]|0)>>>0){ke();return 0}m=n+16|0;if((a[m>>2]|0)==(j|0)){a[m>>2]=z}else{a[n+20>>2]=z}if((z|0)==0){break e}}}while(0);if(z>>>0<(a[212]|0)>>>0){ke();return 0}a[z+24>>2]=n;f=a[j+16>>2]|0;do{if((f|0)!=0){if(f>>>0<(a[212]|0)>>>0){ke();return 0}else{a[z+16>>2]=f;a[f+24>>2]=z;break}}}while(0);f=a[j+20>>2]|0;if((f|0)==0){break}if(f>>>0<(a[212]|0)>>>0){ke();return 0}else{a[z+20>>2]=f;a[f+24>>2]=z;break}}}while(0);do{if(N>>>0<16){n=N+o|0;a[j+4>>2]=n|3;f=v+(n+4)|0;a[f>>2]=a[f>>2]|1}else{a[j+4>>2]=o|3;a[v+(o|4)>>2]=N|1;a[v+(N+o)>>2]=N;f=N>>>3;if(N>>>0<256){n=f<<1;l=872+(n<<2)|0;m=a[208]|0;u=1<>2]|0;if(r>>>0>=(a[212]|0)>>>0){H=r;U=f;break}ke();return 0}}while(0);a[U>>2]=c;a[H+12>>2]=c;a[v+(o+8)>>2]=H;a[v+(o+12)>>2]=l;break}n=b;u=N>>>8;do{if((u|0)==0){D=0}else{if(N>>>0>16777215){D=31;break}m=(u+1048320|0)>>>16&8;f=u<>>16&4;E=f<>>16&2;h=14-(r|m|f)+(E<>>15)|0;D=N>>>((h+7|0)>>>0)&1|h<<1}}while(0);u=1136+(D<<2)|0;a[v+(o+28)>>2]=D;a[v+(o+20)>>2]=0;a[v+(o+16)>>2]=0;l=a[209]|0;h=1<>2]=n;a[v+(o+24)>>2]=u;a[v+(o+12)>>2]=n;a[v+(o+8)>>2]=n;break}if((D|0)==31){q=0}else{q=25-(D>>>1)|0}h=N<>2]|0;while(1){if((a[l+4>>2]&-8|0)==(N|0)){break}K=l+16+(h>>>31<<2)|0;u=a[K>>2]|0;if((u|0)==0){Y=262;break}else{h=h<<1;l=u}}if((Y|0)==262){if(K>>>0<(a[212]|0)>>>0){ke();return 0}else{a[K>>2]=n;a[v+(o+24)>>2]=l;a[v+(o+12)>>2]=n;a[v+(o+8)>>2]=n;break}}h=l+8|0;u=a[h>>2]|0;f=a[212]|0;if(l>>>0>>0){ke();return 0}if(u>>>0>>0){ke();return 0}else{a[u+12>>2]=n;a[h>>2]=n;a[v+(o+8)>>2]=u;a[v+(o+12)>>2]=l;a[v+(o+24)>>2]=0;break}}}while(0);v=j+8|0;if((v|0)==0){p=o;break}else{d=v}return d|0}}while(0);j=a[210]|0;if(p>>>0<=j>>>0){K=j-p|0;N=a[213]|0;if(K>>>0>15){q=N;a[213]=q+p;a[210]=K;a[q+(p+4)>>2]=K|1;a[q+j>>2]=K;a[N+4>>2]=p|3}else{a[210]=0;a[213]=0;a[N+4>>2]=j|3;K=N+(j+4)|0;a[K>>2]=a[K>>2]|1}d=N+8|0;return d|0}N=a[211]|0;if(p>>>0>>0){K=N-p|0;a[211]=K;N=a[214]|0;j=N;a[214]=j+p;a[j+(p+4)>>2]=K|1;a[N+4>>2]=p|3;d=N+8|0;return d|0}do{if((a[200]|0)==0){N=we(8)|0;if((N-1&N|0)==0){a[202]=N;a[201]=N;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);N=p+48|0;K=a[202]|0;j=p+47|0;q=K+j|0;D=-K|0;K=q&D;if(K>>>0<=p>>>0){d=0;return d|0}H=a[318]|0;do{if((H|0)!=0){U=a[316]|0;z=U+K|0;if(z>>>0<=U>>>0|z>>>0>H>>>0){d=0}else{break}return d|0}}while(0);e:do{if((a[319]&4|0)==0){H=a[214]|0;t:do{if((H|0)==0){Y=292}else{z=H;U=1280;while(1){V=U|0;L=a[V>>2]|0;if(L>>>0<=z>>>0){W=U+4|0;if((L+(a[W>>2]|0)|0)>>>0>z>>>0){break}}L=a[U+8>>2]|0;if((L|0)==0){Y=292;break t}else{U=L}}if((U|0)==0){Y=292;break}z=q-(a[211]|0)&D;if(z>>>0>=2147483647){X=0;break}l=Ge(z|0)|0;n=(l|0)==((a[V>>2]|0)+(a[W>>2]|0)|0);Z=n?l:-1;G=n?z:0;Q=l;$=z;Y=301}}while(0);do{if((Y|0)==292){H=Ge(0)|0;if((H|0)==-1){X=0;break}o=H;z=a[201]|0;l=z-1|0;if((l&o|0)==0){J=K}else{J=K-o+(l+o&-z)|0}z=a[316]|0;o=z+J|0;if(!(J>>>0>p>>>0&J>>>0<2147483647)){X=0;break}l=a[318]|0;if((l|0)!=0){if(o>>>0<=z>>>0|o>>>0>l>>>0){X=0;break}}l=Ge(J|0)|0;o=(l|0)==(H|0);Z=o?H:-1;G=o?J:0;Q=l;$=J;Y=301}}while(0);t:do{if((Y|0)==301){l=-$|0;if((Z|0)!=-1){ee=G;te=Z;Y=312;break e}do{if((Q|0)!=-1&$>>>0<2147483647&$>>>0>>0){o=a[202]|0;H=j-$+o&-o;if(H>>>0>=2147483647){re=$;break}if((Ge(H|0)|0)==-1){Ge(l|0)|0;X=G;break t}else{re=H+$|0;break}}else{re=$}}while(0);if((Q|0)==-1){X=G}else{ee=re;te=Q;Y=312;break e}}}while(0);a[319]=a[319]|4;ne=X;Y=309}else{ne=0;Y=309}}while(0);do{if((Y|0)==309){if(K>>>0>=2147483647){break}X=Ge(K|0)|0;Q=Ge(0)|0;if(!((Q|0)!=-1&(X|0)!=-1&X>>>0>>0)){break}re=Q-X|0;Q=re>>>0>(p+40|0)>>>0;G=Q?X:-1;if((G|0)!=-1){ee=Q?re:ne;te=G;Y=312}}}while(0);do{if((Y|0)==312){ne=(a[316]|0)+ee|0;a[316]=ne;if(ne>>>0>(a[317]|0)>>>0){a[317]=ne}ne=a[214]|0;e:do{if((ne|0)==0){K=a[212]|0;if((K|0)==0|te>>>0>>0){a[212]=te}a[320]=te;a[321]=ee;a[323]=0;a[217]=a[200];a[216]=-1;K=0;do{G=K<<1;re=872+(G<<2)|0;a[872+(G+3<<2)>>2]=re;a[872+(G+2<<2)>>2]=re;K=K+1|0}while(K>>>0<32);K=te+8|0;if((K&7|0)==0){ie=0}else{ie=-K&7}K=ee-40-ie|0;a[214]=te+ie;a[211]=K;a[te+(ie+4)>>2]=K|1;a[te+(ee-36)>>2]=40;a[215]=a[204]}else{K=1280;while(1){ae=a[K>>2]|0;oe=K+4|0;se=a[oe>>2]|0;if((te|0)==(ae+se|0)){Y=324;break}re=a[K+8>>2]|0;if((re|0)==0){break}else{K=re}}do{if((Y|0)==324){if((a[K+12>>2]&8|0)!=0){break}re=ne;if(!(re>>>0>=ae>>>0&re>>>0>>0)){break}a[oe>>2]=se+ee;re=a[214]|0;G=(a[211]|0)+ee|0;Q=re;X=re+8|0;if((X&7|0)==0){fe=0}else{fe=-X&7}X=G-fe|0;a[214]=Q+fe;a[211]=X;a[Q+(fe+4)>>2]=X|1;a[Q+(G+4)>>2]=40;a[215]=a[204];break e}}while(0);if(te>>>0<(a[212]|0)>>>0){a[212]=te}K=te+ee|0;G=1280;while(1){ue=G|0;if((a[ue>>2]|0)==(K|0)){Y=334;break}Q=a[G+8>>2]|0;if((Q|0)==0){break}else{G=Q}}do{if((Y|0)==334){if((a[G+12>>2]&8|0)!=0){break}a[ue>>2]=te;K=G+4|0;a[K>>2]=(a[K>>2]|0)+ee;K=te+8|0;if((K&7|0)==0){ce=0}else{ce=-K&7}K=te+(ee+8)|0;if((K&7|0)==0){he=0}else{he=-K&7}K=te+(he+ee)|0;Q=K;X=ce+p|0;re=te+X|0;$=re;j=K-(te+ce)-p|0;a[te+(ce+4)>>2]=p|3;do{if((Q|0)==(a[214]|0)){N=(a[211]|0)+j|0;a[211]=N;a[214]=$;a[te+(X+4)>>2]=N|1}else{if((Q|0)==(a[213]|0)){N=(a[210]|0)+j|0;a[210]=N;a[213]=$;a[te+(X+4)>>2]=N|1;a[te+(N+X)>>2]=N;break}N=ee+4|0;Z=a[te+(N+he)>>2]|0;if((Z&3|0)==1){J=Z&-8;W=Z>>>3;t:do{if(Z>>>0<256){V=a[te+((he|8)+ee)>>2]|0;D=a[te+(ee+12+he)>>2]|0;q=872+(W<<1<<2)|0;do{if((V|0)!=(q|0)){if(V>>>0<(a[212]|0)>>>0){ke();return 0}if((a[V+12>>2]|0)==(Q|0)){break}ke();return 0}}while(0);if((D|0)==(V|0)){a[208]=a[208]&~(1<>>0<(a[212]|0)>>>0){ke();return 0}l=D+8|0;if((a[l>>2]|0)==(Q|0)){le=l;break}ke();return 0}}while(0);a[V+12>>2]=D;a[le>>2]=V}else{q=K;l=a[te+((he|24)+ee)>>2]|0;U=a[te+(ee+12+he)>>2]|0;do{if((U|0)==(q|0)){H=he|16;o=te+(N+H)|0;z=a[o>>2]|0;if((z|0)==0){n=te+(H+ee)|0;H=a[n>>2]|0;if((H|0)==0){de=0;break}else{pe=H;be=n}}else{pe=z;be=o}while(1){o=pe+20|0;z=a[o>>2]|0;if((z|0)!=0){pe=z;be=o;continue}o=pe+16|0;z=a[o>>2]|0;if((z|0)==0){break}else{pe=z;be=o}}if(be>>>0<(a[212]|0)>>>0){ke();return 0}else{a[be>>2]=0;de=pe;break}}else{o=a[te+((he|8)+ee)>>2]|0;if(o>>>0<(a[212]|0)>>>0){ke();return 0}z=o+12|0;if((a[z>>2]|0)!=(q|0)){ke();return 0}n=U+8|0;if((a[n>>2]|0)==(q|0)){a[z>>2]=U;a[n>>2]=o;de=U;break}else{ke();return 0}}}while(0);if((l|0)==0){break}U=te+(ee+28+he)|0;V=1136+(a[U>>2]<<2)|0;do{if((q|0)==(a[V>>2]|0)){a[V>>2]=de;if((de|0)!=0){break}a[209]=a[209]&~(1<>2]);break t}else{if(l>>>0<(a[212]|0)>>>0){ke();return 0}D=l+16|0;if((a[D>>2]|0)==(q|0)){a[D>>2]=de}else{a[l+20>>2]=de}if((de|0)==0){break t}}}while(0);if(de>>>0<(a[212]|0)>>>0){ke();return 0}a[de+24>>2]=l;q=he|16;U=a[te+(q+ee)>>2]|0;do{if((U|0)!=0){if(U>>>0<(a[212]|0)>>>0){ke();return 0}else{a[de+16>>2]=U;a[U+24>>2]=de;break}}}while(0);U=a[te+(N+q)>>2]|0;if((U|0)==0){break}if(U>>>0<(a[212]|0)>>>0){ke();return 0}else{a[de+20>>2]=U;a[U+24>>2]=de;break}}}while(0);ve=te+((J|he)+ee)|0;me=J+j|0}else{ve=Q;me=j}N=ve+4|0;a[N>>2]=a[N>>2]&-2;a[te+(X+4)>>2]=me|1;a[te+(me+X)>>2]=me;N=me>>>3;if(me>>>0<256){W=N<<1;Z=872+(W<<2)|0;U=a[208]|0;l=1<>2]|0;if(V>>>0>=(a[212]|0)>>>0){ge=V;ye=N;break}ke();return 0}}while(0);a[ye>>2]=$;a[ge+12>>2]=$;a[te+(X+8)>>2]=ge;a[te+(X+12)>>2]=Z;break}W=re;l=me>>>8;do{if((l|0)==0){_e=0}else{if(me>>>0>16777215){_e=31;break}U=(l+1048320|0)>>>16&8;J=l<>>16&4;V=J<>>16&2;D=14-(N|U|J)+(V<>>15)|0;_e=me>>>((D+7|0)>>>0)&1|D<<1}}while(0);l=1136+(_e<<2)|0;a[te+(X+28)>>2]=_e;a[te+(X+20)>>2]=0;a[te+(X+16)>>2]=0;Z=a[209]|0;D=1<<_e;if((Z&D|0)==0){a[209]=Z|D;a[l>>2]=W;a[te+(X+24)>>2]=l;a[te+(X+12)>>2]=W;a[te+(X+8)>>2]=W;break}if((_e|0)==31){Se=0}else{Se=25-(_e>>>1)|0}D=me<>2]|0;while(1){if((a[Z+4>>2]&-8|0)==(me|0)){break}xe=Z+16+(D>>>31<<2)|0;l=a[xe>>2]|0;if((l|0)==0){Y=407;break}else{D=D<<1;Z=l}}if((Y|0)==407){if(xe>>>0<(a[212]|0)>>>0){ke();return 0}else{a[xe>>2]=W;a[te+(X+24)>>2]=Z;a[te+(X+12)>>2]=W;a[te+(X+8)>>2]=W;break}}D=Z+8|0;l=a[D>>2]|0;J=a[212]|0;if(Z>>>0>>0){ke();return 0}if(l>>>0>>0){ke();return 0}else{a[l+12>>2]=W;a[D>>2]=W;a[te+(X+8)>>2]=l;a[te+(X+12)>>2]=Z;a[te+(X+24)>>2]=0;break}}}while(0);d=te+(ce|8)|0;return d|0}}while(0);G=ne;X=1280;while(1){Ae=a[X>>2]|0;if(Ae>>>0<=G>>>0){Me=a[X+4>>2]|0;Ee=Ae+Me|0;if(Ee>>>0>G>>>0){break}}X=a[X+8>>2]|0}X=Ae+(Me-39)|0;if((X&7|0)==0){Ie=0}else{Ie=-X&7}X=Ae+(Me-47+Ie)|0;re=X>>>0<(ne+16|0)>>>0?G:X;X=re+8|0;$=te+8|0;if(($&7|0)==0){Te=0}else{Te=-$&7}$=ee-40-Te|0;a[214]=te+Te;a[211]=$;a[te+(Te+4)>>2]=$|1;a[te+(ee-36)>>2]=40;a[215]=a[204];a[re+4>>2]=27;a[X>>2]=a[320];a[X+4>>2]=a[1284>>2];a[X+8>>2]=a[1288>>2];a[X+12>>2]=a[1292>>2];a[320]=te;a[321]=ee;a[323]=0;a[322]=X;X=re+28|0;a[X>>2]=7;if((re+32|0)>>>0>>0){$=X;while(1){X=$+4|0;a[X>>2]=7;if(($+8|0)>>>0>>0){$=X}else{break}}}if((re|0)==(G|0)){break}$=re-ne|0;X=G+($+4)|0;a[X>>2]=a[X>>2]&-2;a[ne+4>>2]=$|1;a[G+$>>2]=$;X=$>>>3;if($>>>0<256){j=X<<1;Q=872+(j<<2)|0;K=a[208]|0;l=1<>2]|0;if(D>>>0>=(a[212]|0)>>>0){Pe=D;Re=X;break}ke();return 0}}while(0);a[Re>>2]=ne;a[Pe+12>>2]=ne;a[ne+8>>2]=Pe;a[ne+12>>2]=Q;break}j=ne;l=$>>>8;do{if((l|0)==0){Be=0}else{if($>>>0>16777215){Be=31;break}K=(l+1048320|0)>>>16&8;G=l<>>16&4;X=G<>>16&2;D=14-(re|K|G)+(X<>>15)|0;Be=$>>>((D+7|0)>>>0)&1|D<<1}}while(0);l=1136+(Be<<2)|0;a[ne+28>>2]=Be;a[ne+20>>2]=0;a[ne+16>>2]=0;Q=a[209]|0;D=1<>2]=j;a[ne+24>>2]=l;a[ne+12>>2]=ne;a[ne+8>>2]=ne;break}if((Be|0)==31){Ce=0}else{Ce=25-(Be>>>1)|0}D=$<>2]|0;while(1){if((a[Q+4>>2]&-8|0)==($|0)){break}Oe=Q+16+(D>>>31<<2)|0;l=a[Oe>>2]|0;if((l|0)==0){Y=442;break}else{D=D<<1;Q=l}}if((Y|0)==442){if(Oe>>>0<(a[212]|0)>>>0){ke();return 0}else{a[Oe>>2]=j;a[ne+24>>2]=Q;a[ne+12>>2]=ne;a[ne+8>>2]=ne;break}}D=Q+8|0;$=a[D>>2]|0;l=a[212]|0;if(Q>>>0>>0){ke();return 0}if($>>>0>>0){ke();return 0}else{a[$+12>>2]=j;a[D>>2]=j;a[ne+8>>2]=$;a[ne+12>>2]=Q;a[ne+24>>2]=0;break}}}while(0);ne=a[211]|0;if(ne>>>0<=p>>>0){break}$=ne-p|0;a[211]=$;ne=a[214]|0;D=ne;a[214]=D+p;a[D+(p+4)>>2]=$|1;a[ne+4>>2]=p|3;d=ne+8|0;return d|0}}while(0);a[($e()|0)>>2]=12;d=0;return d|0}function Yt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,F=0,H=0;if((e|0)==0){return}t=e-8|0;r=t;n=a[212]|0;if(t>>>0>>0){ke()}i=a[e-4>>2]|0;o=i&3;if((o|0)==1){ke()}s=i&-8;f=e+(s-8)|0;u=f;e:do{if((i&1|0)==0){c=a[t>>2]|0;if((o|0)==0){return}h=-8-c|0;l=e+h|0;d=l;p=c+s|0;if(l>>>0>>0){ke()}if((d|0)==(a[213]|0)){b=e+(s-4)|0;if((a[b>>2]&3|0)!=3){v=d;m=p;break}a[210]=p;a[b>>2]=a[b>>2]&-2;a[e+(h+4)>>2]=p|1;a[f>>2]=p;return}b=c>>>3;if(c>>>0<256){c=a[e+(h+8)>>2]|0;g=a[e+(h+12)>>2]|0;y=872+(b<<1<<2)|0;do{if((c|0)!=(y|0)){if(c>>>0>>0){ke()}if((a[c+12>>2]|0)==(d|0)){break}ke()}}while(0);if((g|0)==(c|0)){a[208]=a[208]&~(1<>>0>>0){ke()}_=g+8|0;if((a[_>>2]|0)==(d|0)){w=_;break}ke()}}while(0);a[c+12>>2]=g;a[w>>2]=c;v=d;m=p;break}y=l;b=a[e+(h+24)>>2]|0;_=a[e+(h+12)>>2]|0;do{if((_|0)==(y|0)){S=e+(h+20)|0;k=a[S>>2]|0;if((k|0)==0){x=e+(h+16)|0;A=a[x>>2]|0;if((A|0)==0){M=0;break}else{E=A;I=x}}else{E=k;I=S}while(1){S=E+20|0;k=a[S>>2]|0;if((k|0)!=0){E=k;I=S;continue}S=E+16|0;k=a[S>>2]|0;if((k|0)==0){break}else{E=k;I=S}}if(I>>>0>>0){ke()}else{a[I>>2]=0;M=E;break}}else{S=a[e+(h+8)>>2]|0;if(S>>>0>>0){ke()}k=S+12|0;if((a[k>>2]|0)!=(y|0)){ke()}x=_+8|0;if((a[x>>2]|0)==(y|0)){a[k>>2]=_;a[x>>2]=S;M=_;break}else{ke()}}}while(0);if((b|0)==0){v=d;m=p;break}_=e+(h+28)|0;l=1136+(a[_>>2]<<2)|0;do{if((y|0)==(a[l>>2]|0)){a[l>>2]=M;if((M|0)!=0){break}a[209]=a[209]&~(1<>2]);v=d;m=p;break e}else{if(b>>>0<(a[212]|0)>>>0){ke()}c=b+16|0;if((a[c>>2]|0)==(y|0)){a[c>>2]=M}else{a[b+20>>2]=M}if((M|0)==0){v=d;m=p;break e}}}while(0);if(M>>>0<(a[212]|0)>>>0){ke()}a[M+24>>2]=b;y=a[e+(h+16)>>2]|0;do{if((y|0)!=0){if(y>>>0<(a[212]|0)>>>0){ke()}else{a[M+16>>2]=y;a[y+24>>2]=M;break}}}while(0);y=a[e+(h+20)>>2]|0;if((y|0)==0){v=d;m=p;break}if(y>>>0<(a[212]|0)>>>0){ke()}else{a[M+20>>2]=y;a[y+24>>2]=M;v=d;m=p;break}}else{v=r;m=s}}while(0);r=v;if(r>>>0>=f>>>0){ke()}M=e+(s-4)|0;n=a[M>>2]|0;if((n&1|0)==0){ke()}do{if((n&2|0)==0){if((u|0)==(a[214]|0)){E=(a[211]|0)+m|0;a[211]=E;a[214]=v;a[v+4>>2]=E|1;if((v|0)==(a[213]|0)){a[213]=0;a[210]=0}if(E>>>0<=(a[215]|0)>>>0){return}Qt(0)|0;return}if((u|0)==(a[213]|0)){E=(a[210]|0)+m|0;a[210]=E;a[213]=v;a[v+4>>2]=E|1;a[r+E>>2]=E;return}E=(n&-8)+m|0;I=n>>>3;e:do{if(n>>>0<256){w=a[e+s>>2]|0;o=a[e+(s|4)>>2]|0;t=872+(I<<1<<2)|0;do{if((w|0)!=(t|0)){if(w>>>0<(a[212]|0)>>>0){ke()}if((a[w+12>>2]|0)==(u|0)){break}ke()}}while(0);if((o|0)==(w|0)){a[208]=a[208]&~(1<>>0<(a[212]|0)>>>0){ke()}i=o+8|0;if((a[i>>2]|0)==(u|0)){T=i;break}ke()}}while(0);a[w+12>>2]=o;a[T>>2]=w}else{t=f;i=a[e+(s+16)>>2]|0;y=a[e+(s|4)>>2]|0;do{if((y|0)==(t|0)){b=e+(s+12)|0;_=a[b>>2]|0;if((_|0)==0){l=e+(s+8)|0;c=a[l>>2]|0;if((c|0)==0){P=0;break}else{R=c;B=l}}else{R=_;B=b}while(1){b=R+20|0;_=a[b>>2]|0;if((_|0)!=0){R=_;B=b;continue}b=R+16|0;_=a[b>>2]|0;if((_|0)==0){break}else{R=_;B=b}}if(B>>>0<(a[212]|0)>>>0){ke()}else{a[B>>2]=0;P=R;break}}else{b=a[e+s>>2]|0;if(b>>>0<(a[212]|0)>>>0){ke()}_=b+12|0;if((a[_>>2]|0)!=(t|0)){ke()}l=y+8|0;if((a[l>>2]|0)==(t|0)){a[_>>2]=y;a[l>>2]=b;P=y;break}else{ke()}}}while(0);if((i|0)==0){break}y=e+(s+20)|0;w=1136+(a[y>>2]<<2)|0;do{if((t|0)==(a[w>>2]|0)){a[w>>2]=P;if((P|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(i>>>0<(a[212]|0)>>>0){ke()}o=i+16|0;if((a[o>>2]|0)==(t|0)){a[o>>2]=P}else{a[i+20>>2]=P}if((P|0)==0){break e}}}while(0);if(P>>>0<(a[212]|0)>>>0){ke()}a[P+24>>2]=i;t=a[e+(s+8)>>2]|0;do{if((t|0)!=0){if(t>>>0<(a[212]|0)>>>0){ke()}else{a[P+16>>2]=t;a[t+24>>2]=P;break}}}while(0);t=a[e+(s+12)>>2]|0;if((t|0)==0){break}if(t>>>0<(a[212]|0)>>>0){ke()}else{a[P+20>>2]=t;a[t+24>>2]=P;break}}}while(0);a[v+4>>2]=E|1;a[r+E>>2]=E;if((v|0)!=(a[213]|0)){C=E;break}a[210]=E;return}else{a[M>>2]=n&-2;a[v+4>>2]=m|1;a[r+m>>2]=m;C=m}}while(0);m=C>>>3;if(C>>>0<256){r=m<<1;n=872+(r<<2)|0;M=a[208]|0;P=1<>2]|0;if(s>>>0>=(a[212]|0)>>>0){O=s;N=m;break}ke()}}while(0);a[N>>2]=v;a[O+12>>2]=v;a[v+8>>2]=O;a[v+12>>2]=n;return}n=v;O=C>>>8;do{if((O|0)==0){j=0}else{if(C>>>0>16777215){j=31;break}N=(O+1048320|0)>>>16&8;r=O<>>16&4;M=r<>>16&2;m=14-(P|N|r)+(M<>>15)|0;j=C>>>((m+7|0)>>>0)&1|m<<1}}while(0);O=1136+(j<<2)|0;a[v+28>>2]=j;a[v+20>>2]=0;a[v+16>>2]=0;m=a[209]|0;r=1<>2]=n;a[v+24>>2]=O;a[v+12>>2]=v;a[v+8>>2]=v}else{if((j|0)==31){z=0}else{z=25-(j>>>1)|0}M=C<>2]|0;while(1){if((a[N+4>>2]&-8|0)==(C|0)){break}L=N+16+(M>>>31<<2)|0;P=a[L>>2]|0;if((P|0)==0){F=621;break}else{M=M<<1;N=P}}if((F|0)==621){if(L>>>0<(a[212]|0)>>>0){ke()}else{a[L>>2]=n;a[v+24>>2]=N;a[v+12>>2]=v;a[v+8>>2]=v;break}}M=N+8|0;E=a[M>>2]|0;P=a[212]|0;if(N>>>0

>>0){ke()}if(E>>>0

>>0){ke()}else{a[E+12>>2]=n;a[M>>2]=n;a[v+8>>2]=E;a[v+12>>2]=N;a[v+24>>2]=0;break}}}while(0);v=(a[216]|0)-1|0;a[216]=v;if((v|0)==0){H=1288}else{return}while(1){v=a[H>>2]|0;if((v|0)==0){break}else{H=v+8|0}}a[216]=-1;return}function Vt(e,t){e=e|0;t=t|0;var r=0,n=0;do{if((e|0)==0){r=0}else{n=oe(t,e)|0;if((t|e)>>>0<=65535){r=n;break}r=((n>>>0)/(e>>>0)|0|0)==(t|0)?n:-1}}while(0);t=Kt(r)|0;if((t|0)==0){return t|0}if((a[t-4>>2]&3|0)==0){return t|0}en(t|0,0,r|0);return t|0}function Wt(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0;if((e|0)==0){r=Kt(t)|0;return r|0}if(t>>>0>4294967231){a[($e()|0)>>2]=12;r=0;return r|0}if(t>>>0<11){n=16}else{n=t+11&-8}i=$t(e-8|0,n)|0;if((i|0)!=0){r=i+8|0;return r|0}i=Kt(t)|0;if((i|0)==0){r=0;return r|0}n=a[e-4>>2]|0;o=(n&-8)-((n&3|0)==0?8:4)|0;n=o>>>0>>0?o:t;Jr(i|0,e|0,n)|0;Yt(e);r=i;return r|0}function Xt(e,t){e=e|0;t=t|0;var r=0;if((e|0)==0){return 0}if(t>>>0>4294967231){a[($e()|0)>>2]=12;return 0}if(t>>>0<11){r=16}else{r=t+11&-8}t=e-8|0;return(($t(t,r)|0)==(t|0)?e:0)|0}function Zt(e,t){e=e|0;t=t|0;var r=0;if(e>>>0<9){r=Kt(t)|0;return r|0}else{r=Gt(e,t)|0;return r|0}return 0}function Gt(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0;r=e>>>0<16?16:e;if((r-1&r|0)==0){n=r}else{e=16;while(1){if(e>>>0>>0){e=e<<1}else{n=e;break}}}if((-64-n|0)>>>0<=t>>>0){a[($e()|0)>>2]=12;i=0;return i|0}if(t>>>0<11){o=16}else{o=t+11&-8}t=Kt(n+12+o|0)|0;if((t|0)==0){i=0;return i|0}e=t-8|0;r=e;s=n-1|0;do{if((t&s|0)==0){f=r}else{u=t+s&-n;c=u-8|0;h=e;if((c-h|0)>>>0>15){l=c}else{l=u+(n-8)|0}u=l;c=l-h|0;h=t-4|0;d=a[h>>2]|0;p=(d&-8)-c|0;if((d&3|0)==0){a[l>>2]=(a[e>>2]|0)+c;a[l+4>>2]=p;f=u;break}else{d=l+4|0;a[d>>2]=p|a[d>>2]&1|2;d=l+(p+4)|0;a[d>>2]=a[d>>2]|1;a[h>>2]=c|a[h>>2]&1|2;h=t+(c-4)|0;a[h>>2]=a[h>>2]|1;vr(r,c);f=u;break}}}while(0);r=f+4|0;t=a[r>>2]|0;do{if((t&3|0)!=0){l=t&-8;if(l>>>0<=(o+16|0)>>>0){break}e=l-o|0;n=f;a[r>>2]=o|t&1|2;a[n+(o|4)>>2]=e|3;s=n+(l|4)|0;a[s>>2]=a[s>>2]|1;vr(n+o|0,e)}}while(0);i=f+8|0;return i|0}function Qt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);if(e>>>0>=4294967232){r=0;return r|0}t=a[214]|0;if((t|0)==0){r=0;return r|0}n=a[211]|0;do{if(n>>>0>(e+40|0)>>>0){i=a[202]|0;o=oe((((-40-e-1+n+i|0)>>>0)/(i>>>0)|0)-1|0,i)|0;s=t;f=1280;while(1){u=a[f>>2]|0;if(u>>>0<=s>>>0){if((u+(a[f+4>>2]|0)|0)>>>0>s>>>0){c=f;break}}u=a[f+8>>2]|0;if((u|0)==0){c=0;break}else{f=u}}if((a[c+12>>2]&8|0)!=0){break}f=Ge(0)|0;s=c+4|0;if((f|0)!=((a[c>>2]|0)+(a[s>>2]|0)|0)){break}u=Ge(-(o>>>0>2147483646?-2147483648-i|0:o)|0)|0;h=Ge(0)|0;if(!((u|0)!=-1&h>>>0>>0)){break}u=f-h|0;if((f|0)==(h|0)){break}a[s>>2]=(a[s>>2]|0)-u;a[316]=(a[316]|0)-u;s=a[214]|0;l=(a[211]|0)-u|0;u=s;d=s+8|0;if((d&7|0)==0){p=0}else{p=-d&7}d=l-p|0;a[214]=u+p;a[211]=d;a[u+(p+4)>>2]=d|1;a[u+(l+4)>>2]=40;a[215]=a[204];r=(f|0)!=(h|0)|0;return r|0}}while(0);if((a[211]|0)>>>0<=(a[215]|0)>>>0){r=0;return r|0}a[215]=-1;r=0;return r|0}function $t(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0;r=e+4|0;n=a[r>>2]|0;i=n&-8;o=e;s=o+i|0;f=s;u=a[212]|0;if(o>>>0>>0){ke();return 0}c=n&3;if(!((c|0)!=1&o>>>0>>0)){ke();return 0}h=o+(i|4)|0;l=a[h>>2]|0;if((l&1|0)==0){ke();return 0}if((c|0)==0){if(t>>>0<256){d=0;return d|0}do{if(i>>>0>=(t+4|0)>>>0){if((i-t|0)>>>0>a[202]<<1>>>0){break}else{d=e}return d|0}}while(0);d=0;return d|0}if(i>>>0>=t>>>0){c=i-t|0;if(c>>>0<=15){d=e;return d|0}a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=c|3;a[h>>2]=a[h>>2]|1;vr(o+t|0,c);d=e;return d|0}if((f|0)==(a[214]|0)){c=(a[211]|0)+i|0;if(c>>>0<=t>>>0){d=0;return d|0}h=c-t|0;a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=h|1;a[214]=o+t;a[211]=h;d=e;return d|0}if((f|0)==(a[213]|0)){h=(a[210]|0)+i|0;if(h>>>0>>0){d=0;return d|0}c=h-t|0;if(c>>>0>15){a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=c|1;a[o+h>>2]=c;p=o+(h+4)|0;a[p>>2]=a[p>>2]&-2;b=o+t|0;v=c}else{a[r>>2]=n&1|h|2;n=o+(h+4)|0;a[n>>2]=a[n>>2]|1;b=0;v=0}a[210]=v;a[213]=b;d=e;return d|0}if((l&2|0)!=0){d=0;return d|0}b=(l&-8)+i|0;if(b>>>0>>0){d=0;return d|0}v=b-t|0;n=l>>>3;e:do{if(l>>>0<256){h=a[o+(i+8)>>2]|0;c=a[o+(i+12)>>2]|0;p=872+(n<<1<<2)|0;do{if((h|0)!=(p|0)){if(h>>>0>>0){ke();return 0}if((a[h+12>>2]|0)==(f|0)){break}ke();return 0}}while(0);if((c|0)==(h|0)){a[208]=a[208]&~(1<>>0>>0){ke();return 0}g=c+8|0;if((a[g>>2]|0)==(f|0)){m=g;break}ke();return 0}}while(0);a[h+12>>2]=c;a[m>>2]=h}else{p=s;g=a[o+(i+24)>>2]|0;y=a[o+(i+12)>>2]|0;do{if((y|0)==(p|0)){w=o+(i+20)|0;_=a[w>>2]|0;if((_|0)==0){S=o+(i+16)|0;k=a[S>>2]|0;if((k|0)==0){x=0;break}else{A=k;M=S}}else{A=_;M=w}while(1){w=A+20|0;_=a[w>>2]|0;if((_|0)!=0){A=_;M=w;continue}w=A+16|0;_=a[w>>2]|0;if((_|0)==0){break}else{A=_;M=w}}if(M>>>0>>0){ke();return 0}else{a[M>>2]=0;x=A;break}}else{w=a[o+(i+8)>>2]|0;if(w>>>0>>0){ke();return 0}_=w+12|0;if((a[_>>2]|0)!=(p|0)){ke();return 0}S=y+8|0;if((a[S>>2]|0)==(p|0)){a[_>>2]=y;a[S>>2]=w;x=y;break}else{ke();return 0}}}while(0);if((g|0)==0){break}y=o+(i+28)|0;h=1136+(a[y>>2]<<2)|0;do{if((p|0)==(a[h>>2]|0)){a[h>>2]=x;if((x|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(g>>>0<(a[212]|0)>>>0){ke();return 0}c=g+16|0;if((a[c>>2]|0)==(p|0)){a[c>>2]=x}else{a[g+20>>2]=x}if((x|0)==0){break e}}}while(0);if(x>>>0<(a[212]|0)>>>0){ke();return 0}a[x+24>>2]=g;p=a[o+(i+16)>>2]|0;do{if((p|0)!=0){if(p>>>0<(a[212]|0)>>>0){ke();return 0}else{a[x+16>>2]=p;a[p+24>>2]=x;break}}}while(0);p=a[o+(i+20)>>2]|0;if((p|0)==0){break}if(p>>>0<(a[212]|0)>>>0){ke();return 0}else{a[x+20>>2]=p;a[p+24>>2]=x;break}}}while(0);if(v>>>0<16){a[r>>2]=b|a[r>>2]&1|2;x=o+(b|4)|0;a[x>>2]=a[x>>2]|1;d=e;return d|0}else{a[r>>2]=a[r>>2]&1|t|2;a[o+(t+4)>>2]=v|3;r=o+(b|4)|0;a[r>>2]=a[r>>2]|1;vr(o+t|0,v);d=e;return d|0}return 0}function Jt(){return a[316]|0}function er(){return a[317]|0}function tr(){var e=0;e=a[318]|0;return((e|0)==0?-1:e)|0}function rr(e){e=e|0;var t=0,r=0;if((e|0)==-1){t=0}else{r=a[202]|0;t=e-1+r&-r}a[318]=t;return t|0}function nr(e){e=e|0;var t=0,r=0,n=0;do{if((e|0)==0){t=0}else{r=a[e-4>>2]|0;n=r&3;if((n|0)==1){t=0;break}t=(r&-8)-((n|0)==0?8:4)|0}}while(0);return t|0}function ir(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,o=0;do{if((t|0)==8){n=Kt(r)|0}else{i=t>>>2;if((t&3|0)!=0|(i|0)==0){o=22;return o|0}if((i+1073741823&i|0)!=0){o=22;return o|0}if((-64-t|0)>>>0>>0){o=12;return o|0}else{n=Gt(t>>>0<16?16:t,r)|0;break}}}while(0);if((n|0)==0){o=12;return o|0}a[e>>2]=n;o=0;return o|0}function ar(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+8|0;i=n|0;a[i>>2]=t;t=ur(e,i,3,r)|0;h=n;return t|0}function or(e,t,r){e=e|0;t=t|0;r=r|0;return ur(e,t,0,r)|0}function sr(e){e=e|0;var t=0,r=0,n=0;if((a[200]|0)!=0){t=a[201]|0;r=Zt(t,e)|0;return r|0}n=we(8)|0;if((n-1&n|0)!=0){ke();return 0}a[202]=n;a[201]=n;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;t=a[201]|0;r=Zt(t,e)|0;return r|0}function fr(e){e=e|0;var t=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);t=a[201]|0;return Zt(t,e-1+t&-t)|0}function ur(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0;do{if((a[200]|0)==0){i=we(8)|0;if((i-1&i|0)==0){a[202]=i;a[201]=i;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);i=(e|0)==0;do{if((n|0)==0){if(i){o=Kt(0)|0;return o|0}else{s=e<<2;if(s>>>0<11){f=0;u=16;break}f=0;u=s+11&-8;break}}else{if(i){o=n}else{f=n;u=0;break}return o|0}}while(0);do{if((r&1|0)==0){if(i){c=0;h=0;break}else{l=0;d=0}while(1){n=a[t+(d<<2)>>2]|0;if(n>>>0<11){p=16}else{p=n+11&-8}n=p+l|0;s=d+1|0;if((s|0)==(e|0)){c=0;h=n;break}else{l=n;d=s}}}else{s=a[t>>2]|0;if(s>>>0<11){b=16}else{b=s+11&-8}c=b;h=oe(b,e)|0}}while(0);b=Kt(u-4+h|0)|0;if((b|0)==0){o=0;return o|0}d=b-8|0;l=a[b-4>>2]&-8;if((r&2|0)!=0){en(b|0,0,-4-u+l|0)}if((f|0)==0){a[b+(h-4)>>2]=l-h|3;v=b+h|0;m=h}else{v=f;m=l}a[v>>2]=b;b=e-1|0;e:do{if((b|0)==0){g=d;y=m}else{if((c|0)==0){w=d;_=m;S=0}else{e=d;l=m;f=0;while(1){h=l-c|0;a[e+4>>2]=c|3;u=e+c|0;r=f+1|0;a[v+(r<<2)>>2]=e+(c+8);if((r|0)==(b|0)){g=u;y=h;break e}else{e=u;l=h;f=r}}}while(1){f=a[t+(S<<2)>>2]|0;if(f>>>0<11){k=16}else{k=f+11&-8}f=_-k|0;a[w+4>>2]=k|3;l=w+k|0;e=S+1|0;a[v+(e<<2)>>2]=w+(k+8);if((e|0)==(b|0)){g=l;y=f;break}else{w=l;_=f;S=e}}}}while(0);a[g+4>>2]=y|3;o=v;return o|0}function cr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0;r=e+(t<<2)|0;e:do{if((t|0)!=0){n=e;t:while(1){i=a[n>>2]|0;r:do{if((i|0)==0){o=n+4|0}else{s=i-8|0;f=s;u=i-4|0;c=a[u>>2]&-8;a[n>>2]=0;if(s>>>0<(a[212]|0)>>>0){h=935;break t}s=a[u>>2]|0;if((s&3|0)==1){h=936;break t}l=n+4|0;d=s-8&-8;do{if((l|0)!=(r|0)){if((a[l>>2]|0)!=(i+(d+8)|0)){break}p=(a[i+(d|4)>>2]&-8)+c|0;a[u>>2]=s&1|p|2;b=i+(p-4)|0;a[b>>2]=a[b>>2]|1;a[l>>2]=i;o=l;break r}}while(0);vr(f,c);o=l}}while(0);if((o|0)==(r|0)){break e}else{n=o}}if((h|0)==935){ke();return 0}else if((h|0)==936){ke();return 0}}}while(0);if((a[211]|0)>>>0<=(a[215]|0)>>>0){return 0}Qt(0)|0;return 0}function hr(e){e=e|0;var t=0,r=0;if((a[200]|0)!=0){t=Qt(e)|0;return t|0}r=we(8)|0;if((r-1&r|0)!=0){ke();return 0}a[202]=r;a[201]=r;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;t=Qt(e)|0;return t|0}function lr(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke()}}}while(0);t=a[214]|0;if((t|0)==0){r=0;n=0;i=0;o=0;s=0;f=0;u=0}else{c=a[211]|0;h=c+40|0;l=1;d=h;p=h;h=1280;while(1){b=a[h>>2]|0;v=b+8|0;if((v&7|0)==0){m=0}else{m=-v&7}v=b+(a[h+4>>2]|0)|0;g=l;y=d;w=p;_=b+m|0;while(1){if(_>>>0>=v>>>0|(_|0)==(t|0)){S=g;k=y;x=w;break}A=a[_+4>>2]|0;if((A|0)==7){S=g;k=y;x=w;break}M=A&-8;E=M+w|0;if((A&3|0)==1){I=M+y|0;T=g+1|0}else{I=y;T=g}A=_+M|0;if(A>>>0>>0){S=T;k=I;x=E;break}else{g=T;y=I;w=E;_=A}}_=a[h+8>>2]|0;if((_|0)==0){break}else{l=S;d=k;p=x;h=_}}h=a[316]|0;r=c;n=x;i=S;o=h-x|0;s=a[317]|0;f=h-k|0;u=k}a[e>>2]=n;a[e+4>>2]=i;i=e+8|0;a[i>>2]=0;a[i+4>>2]=0;a[e+16>>2]=o;a[e+20>>2]=s;a[e+24>>2]=0;a[e+28>>2]=f;a[e+32>>2]=u;a[e+36>>2]=r;return}function dr(){var e=0,t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,g=0,y=0,w=0;e=h;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke()}}}while(0);t=a[214]|0;if((t|0)==0){r=0;n=0;i=0}else{o=a[317]|0;s=a[316]|0;f=s-40-(a[211]|0)|0;u=1280;while(1){c=a[u>>2]|0;l=c+8|0;if((l&7|0)==0){d=0}else{d=-l&7}l=c+(a[u+4>>2]|0)|0;p=f;b=c+d|0;while(1){if(b>>>0>=l>>>0|(b|0)==(t|0)){v=p;break}g=a[b+4>>2]|0;if((g|0)==7){v=p;break}y=g&-8;w=p-((g&3|0)==1?y:0)|0;g=b+y|0;if(g>>>0>>0){v=w;break}else{p=w;b=g}}b=a[u+8>>2]|0;if((b|0)==0){r=v;n=s;i=o;break}else{f=v;u=b}}}xe(a[m>>2]|0,520,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;xe(a[m>>2]|0,488,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;xe(a[m>>2]|0,400,(E=h,h=h+8|0,a[E>>2]=r,E)|0)|0;h=e;return}function pr(e,t){e=e|0;t=t|0;var r=0,n=0;do{if((a[200]|0)==0){r=we(8)|0;if((r-1&r|0)==0){a[202]=r;a[201]=r;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);if((e|0)==(-1|0)){a[204]=t;n=1;return n|0}else if((e|0)==(-2|0)){if((a[201]|0)>>>0>t>>>0){n=0;return n|0}if((t-1&t|0)!=0){n=0;return n|0}a[202]=t;n=1;return n|0}else if((e|0)==(-3|0)){a[203]=t;n=1;return n|0}else{n=0;return n|0}return 0}function br(){return(O=a[328]|0,a[328]=O+0,O)|0}function vr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0;r=e;n=r+t|0;i=n;o=a[e+4>>2]|0;e:do{if((o&1|0)==0){s=a[e>>2]|0;if((o&3|0)==0){return}f=r+(-s|0)|0;u=f;c=s+t|0;h=a[212]|0;if(f>>>0>>0){ke()}if((u|0)==(a[213]|0)){l=r+(t+4)|0;if((a[l>>2]&3|0)!=3){d=u;p=c;break}a[210]=c;a[l>>2]=a[l>>2]&-2;a[r+(4-s)>>2]=c|1;a[n>>2]=c;return}l=s>>>3;if(s>>>0<256){b=a[r+(8-s)>>2]|0;v=a[r+(12-s)>>2]|0;m=872+(l<<1<<2)|0;do{if((b|0)!=(m|0)){if(b>>>0>>0){ke()}if((a[b+12>>2]|0)==(u|0)){break}ke()}}while(0);if((v|0)==(b|0)){a[208]=a[208]&~(1<>>0>>0){ke()}y=v+8|0;if((a[y>>2]|0)==(u|0)){g=y;break}ke()}}while(0);a[b+12>>2]=v;a[g>>2]=b;d=u;p=c;break}m=f;l=a[r+(24-s)>>2]|0;y=a[r+(12-s)>>2]|0;do{if((y|0)==(m|0)){w=16-s|0;_=r+(w+4)|0;S=a[_>>2]|0;if((S|0)==0){k=r+w|0;w=a[k>>2]|0;if((w|0)==0){x=0;break}else{A=w;M=k}}else{A=S;M=_}while(1){_=A+20|0;S=a[_>>2]|0;if((S|0)!=0){A=S;M=_;continue}_=A+16|0;S=a[_>>2]|0;if((S|0)==0){break}else{A=S;M=_}}if(M>>>0>>0){ke()}else{a[M>>2]=0;x=A;break}}else{_=a[r+(8-s)>>2]|0;if(_>>>0>>0){ke()}S=_+12|0;if((a[S>>2]|0)!=(m|0)){ke()}k=y+8|0;if((a[k>>2]|0)==(m|0)){a[S>>2]=y;a[k>>2]=_;x=y;break}else{ke()}}}while(0);if((l|0)==0){d=u;p=c;break}y=r+(28-s)|0;h=1136+(a[y>>2]<<2)|0;do{if((m|0)==(a[h>>2]|0)){a[h>>2]=x;if((x|0)!=0){break}a[209]=a[209]&~(1<>2]);d=u;p=c;break e}else{if(l>>>0<(a[212]|0)>>>0){ke()}f=l+16|0;if((a[f>>2]|0)==(m|0)){a[f>>2]=x}else{a[l+20>>2]=x}if((x|0)==0){d=u;p=c;break e}}}while(0);if(x>>>0<(a[212]|0)>>>0){ke()}a[x+24>>2]=l;m=16-s|0;y=a[r+m>>2]|0;do{if((y|0)!=0){if(y>>>0<(a[212]|0)>>>0){ke()}else{a[x+16>>2]=y;a[y+24>>2]=x;break}}}while(0);y=a[r+(m+4)>>2]|0;if((y|0)==0){d=u;p=c;break}if(y>>>0<(a[212]|0)>>>0){ke()}else{a[x+20>>2]=y;a[y+24>>2]=x;d=u;p=c;break}}else{d=e;p=t}}while(0);e=a[212]|0;if(n>>>0>>0){ke()}x=r+(t+4)|0;A=a[x>>2]|0;do{if((A&2|0)==0){if((i|0)==(a[214]|0)){M=(a[211]|0)+p|0;a[211]=M;a[214]=d;a[d+4>>2]=M|1;if((d|0)!=(a[213]|0)){return}a[213]=0;a[210]=0;return}if((i|0)==(a[213]|0)){M=(a[210]|0)+p|0;a[210]=M;a[213]=d;a[d+4>>2]=M|1;a[d+M>>2]=M;return}M=(A&-8)+p|0;g=A>>>3;e:do{if(A>>>0<256){o=a[r+(t+8)>>2]|0;y=a[r+(t+12)>>2]|0;s=872+(g<<1<<2)|0;do{if((o|0)!=(s|0)){if(o>>>0>>0){ke()}if((a[o+12>>2]|0)==(i|0)){break}ke()}}while(0);if((y|0)==(o|0)){a[208]=a[208]&~(1<>>0>>0){ke()}l=y+8|0;if((a[l>>2]|0)==(i|0)){E=l;break}ke()}}while(0);a[o+12>>2]=y;a[E>>2]=o}else{s=n;l=a[r+(t+24)>>2]|0;h=a[r+(t+12)>>2]|0;do{if((h|0)==(s|0)){f=r+(t+20)|0;b=a[f>>2]|0;if((b|0)==0){v=r+(t+16)|0;_=a[v>>2]|0;if((_|0)==0){I=0;break}else{T=_;P=v}}else{T=b;P=f}while(1){f=T+20|0;b=a[f>>2]|0;if((b|0)!=0){T=b;P=f;continue}f=T+16|0;b=a[f>>2]|0;if((b|0)==0){break}else{T=b;P=f}}if(P>>>0>>0){ke()}else{a[P>>2]=0;I=T;break}}else{f=a[r+(t+8)>>2]|0;if(f>>>0>>0){ke()}b=f+12|0;if((a[b>>2]|0)!=(s|0)){ke()}v=h+8|0;if((a[v>>2]|0)==(s|0)){a[b>>2]=h;a[v>>2]=f;I=h;break}else{ke()}}}while(0);if((l|0)==0){break}h=r+(t+28)|0;o=1136+(a[h>>2]<<2)|0;do{if((s|0)==(a[o>>2]|0)){a[o>>2]=I;if((I|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(l>>>0<(a[212]|0)>>>0){ke()}y=l+16|0;if((a[y>>2]|0)==(s|0)){a[y>>2]=I}else{a[l+20>>2]=I}if((I|0)==0){break e}}}while(0);if(I>>>0<(a[212]|0)>>>0){ke()}a[I+24>>2]=l;s=a[r+(t+16)>>2]|0;do{if((s|0)!=0){if(s>>>0<(a[212]|0)>>>0){ke()}else{a[I+16>>2]=s;a[s+24>>2]=I;break}}}while(0);s=a[r+(t+20)>>2]|0;if((s|0)==0){break}if(s>>>0<(a[212]|0)>>>0){ke()}else{a[I+20>>2]=s;a[s+24>>2]=I;break}}}while(0);a[d+4>>2]=M|1;a[d+M>>2]=M;if((d|0)!=(a[213]|0)){R=M;break}a[210]=M;return}else{a[x>>2]=A&-2;a[d+4>>2]=p|1;a[d+p>>2]=p;R=p}}while(0);p=R>>>3;if(R>>>0<256){A=p<<1;x=872+(A<<2)|0;I=a[208]|0;t=1<>2]|0;if(r>>>0>=(a[212]|0)>>>0){B=r;C=p;break}ke()}}while(0);a[C>>2]=d;a[B+12>>2]=d;a[d+8>>2]=B;a[d+12>>2]=x;return}x=d;B=R>>>8;do{if((B|0)==0){O=0}else{if(R>>>0>16777215){O=31;break}C=(B+1048320|0)>>>16&8;A=B<>>16&4;I=A<>>16&2;p=14-(t|C|A)+(I<>>15)|0;O=R>>>((p+7|0)>>>0)&1|p<<1}}while(0);B=1136+(O<<2)|0;a[d+28>>2]=O;a[d+20>>2]=0;a[d+16>>2]=0;p=a[209]|0;A=1<>2]=x;a[d+24>>2]=B;a[d+12>>2]=d;a[d+8>>2]=d;return}if((O|0)==31){N=0}else{N=25-(O>>>1)|0}O=R<>2]|0;while(1){if((a[N+4>>2]&-8|0)==(R|0)){break}j=N+16+(O>>>31<<2)|0;B=a[j>>2]|0;if((B|0)==0){z=1120;break}else{O=O<<1;N=B}}if((z|0)==1120){if(j>>>0<(a[212]|0)>>>0){ke()}a[j>>2]=x;a[d+24>>2]=N;a[d+12>>2]=d;a[d+8>>2]=d;return}j=N+8|0;z=a[j>>2]|0;O=a[212]|0;if(N>>>0>>0){ke()}if(z>>>0>>0){ke()}a[z+12>>2]=x;a[j>>2]=x;a[d+8>>2]=z;a[d+12>>2]=N;a[d+24>>2]=0;return}function mr(e){e=e|0;var t=0,r=0,n=0;t=(e|0)==0?1:e;while(1){r=Kt(t)|0;if((r|0)!=0){n=1164;break}e=(O=a[328]|0,a[328]=O+0,O);if((e|0)==0){break}Cn[e&1]()}if((n|0)==1164){return r|0}r=Le(4)|0;a[r>>2]=560;_e(r|0,688,6);return 0}function gr(e,t){e=e|0;t=t|0;return mr(e)|0}function yr(e){e=e|0;return}function wr(e){e=e|0;return 360|0}function _r(e){e=e|0;return 448|0}function Sr(e){e=e|0;return(O=a[328]|0,a[328]=e,O)|0}function kr(e){e=e|0;a[e>>2]=560;return}function xr(e){e=e|0;a[e>>2]=592;return}function Ar(e){e=e|0;if((e|0)!=0){Yt(e)}return}function Mr(e,t){e=e|0;t=t|0;Ar(e);return}function Er(e){e=e|0;Ar(e);return}function Ir(e,t){e=e|0;t=t|0;Er(e);return}function Tr(e){e=e|0;Ar(e);return}function Pr(e){e=e|0;Ar(e);return}function Rr(e,t,r){e=e|0;t=t|0;r=r|0;return Br(e,t,r,0,0,0)|0}function Br(e,t,r,i,o,s){e=e|0;t=t|0;r=r|0;i=i|0;o=o|0;s=s|0;var f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,F=0,H=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0,re=0,ne=0;f=h;if((r|0)==0){u=-1;h=f;return u|0}c=a[44]|0;if((c|0)==0){a[196]=1;a[44]=1;l=1;d=1;p=1190}else{b=a[196]|0;v=a[74]|0;if((v|0)==-1|(b|0)!=0){l=b;d=c;p=1190}else{m=v;g=b;y=c}}if((p|0)==1190){c=(Ke(344)|0)!=0|0;a[74]=c;m=c;g=l;y=d}d=n[r]|0;if(d<<24>>24==45){w=s|2;p=1194}else{l=(m|0)!=0|d<<24>>24==43?s&-2:s;if(d<<24>>24==43){w=l;p=1194}else{_=r;S=l}}if((p|0)==1194){_=r+1|0;S=w}a[198]=0;if((g|0)==0){k=y;p=1198}else{a[50]=-1;a[48]=-1;x=y;A=g;p=1197}while(1){if((p|0)==1197){p=0;if((A|0)==0){k=x;p=1198;continue}else{M=x}}else if((p|0)==1198){p=0;g=a[40]|0;if((n[g]|0)==0){M=k}else{I=g;T=k;break}}a[196]=0;if((M|0)>=(e|0)){p=1200;break}P=t+(M<<2)|0;R=a[P>>2]|0;a[40]=R;if((n[R]|0)==45){B=R+1|0;C=n[B]|0;if(C<<24>>24!=0){p=1232;break}if((Pe(_|0,45)|0)!=0){p=1232;break}}a[40]=824;if((S&2|0)!=0){p=1217;break}if((S&1|0)==0){u=-1;p=1298;break}g=a[48]|0;do{if((g|0)==-1){a[48]=M;O=M;N=0}else{y=a[50]|0;if((y|0)==-1){O=M;N=0;break}w=y-g|0;r=M-y|0;l=(w|0)%(r|0)|0;if((l|0)==0){j=r}else{d=r;s=l;while(1){l=(d|0)%(s|0)|0;if((l|0)==0){j=s;break}else{d=s;s=l}}}s=(M-g|0)/(j|0)|0;do{if((j|0)>0){d=-w|0;if((s|0)>0){z=0}else{L=M;F=y;H=g;U=0;break}do{l=z+y|0;m=t+(l<<2)|0;c=0;b=l;l=a[m>>2]|0;while(1){v=((b|0)<(y|0)?r:d)+b|0;D=t+(v<<2)|0;q=a[D>>2]|0;a[D>>2]=l;a[m>>2]=q;D=c+1|0;if((D|0)<(s|0)){c=D;b=v;l=q}else{break}}z=z+1|0}while((z|0)<(j|0));L=a[44]|0;F=a[50]|0;H=a[48]|0;U=a[196]|0}else{L=M;F=y;H=g;U=0}}while(0);a[48]=L-F+H;a[50]=-1;O=L;N=U}}while(0);g=O+1|0;a[44]=g;x=g;A=N;p=1197}do{if((p|0)==1298){h=f;return u|0}else if((p|0)==1232){N=a[48]|0;A=a[50]|0;if((N|0)!=-1&(A|0)==-1){a[50]=M;K=n[B]|0;Y=M}else{K=C;Y=A}if(K<<24>>24==0){I=R;T=M;break}a[40]=B;if((n[B]|0)!=45){I=B;T=M;break}if((n[R+2|0]|0)!=0){I=B;T=M;break}A=M+1|0;a[44]=A;a[40]=824;if((Y|0)!=-1){x=Y-N|0;O=A-Y|0;U=(x|0)%(O|0)|0;if((U|0)==0){V=O}else{L=O;H=U;while(1){U=(L|0)%(H|0)|0;if((U|0)==0){V=H;break}else{L=H;H=U}}}H=(A-N|0)/(V|0)|0;do{if((V|0)>0){L=-x|0;if((H|0)>0){W=0}else{X=Y;Z=N;G=A;break}do{U=W+Y|0;F=t+(U<<2)|0;j=0;z=U;U=a[F>>2]|0;while(1){k=((z|0)<(Y|0)?O:L)+z|0;g=t+(k<<2)|0;y=a[g>>2]|0;a[g>>2]=U;a[F>>2]=y;g=j+1|0;if((g|0)<(H|0)){j=g;z=k;U=y}else{break}}W=W+1|0}while((W|0)<(V|0));X=a[50]|0;Z=a[48]|0;G=a[44]|0}else{X=Y;Z=N;G=A}}while(0);a[44]=Z-X+G}a[50]=-1;a[48]=-1;u=-1;h=f;return u|0}else if((p|0)==1200){a[40]=824;A=a[50]|0;N=a[48]|0;do{if((A|0)==-1){if((N|0)==-1){break}a[44]=N}else{H=A-N|0;O=M-A|0;x=(H|0)%(O|0)|0;if((x|0)==0){Q=O}else{L=O;U=x;while(1){x=(L|0)%(U|0)|0;if((x|0)==0){Q=U;break}else{L=U;U=x}}}U=(M-N|0)/(Q|0)|0;do{if((Q|0)>0){L=-H|0;if((U|0)>0){$=0}else{J=A;ee=N;te=M;break}do{x=$+A|0;z=t+(x<<2)|0;j=0;F=x;x=a[z>>2]|0;while(1){y=((F|0)<(A|0)?O:L)+F|0;k=t+(y<<2)|0;g=a[k>>2]|0;a[k>>2]=x;a[z>>2]=g;k=j+1|0;if((k|0)<(U|0)){j=k;F=y;x=g}else{break}}$=$+1|0}while(($|0)<(Q|0));J=a[50]|0;ee=a[48]|0;te=a[44]|0}else{J=A;ee=N;te=M}}while(0);a[44]=ee-J+te}}while(0);a[50]=-1;a[48]=-1;u=-1;h=f;return u|0}else if((p|0)==1217){a[44]=M+1;a[198]=a[P>>2];u=1;h=f;return u|0}}while(0);P=(i|0)!=0;e:do{if(P){if((I|0)==(a[t+(T<<2)>>2]|0)){re=I;break}M=n[I]|0;do{if(M<<24>>24==45){a[40]=I+1;ne=0}else{if((S&4|0)==0){re=I;break e}if(M<<24>>24==58){ne=0;break}ne=(Pe(_|0,M<<24>>24|0)|0)!=0|0}}while(0);M=Lr(t,_,i,o,ne)|0;if((M|0)==-1){re=a[40]|0;break}a[40]=824;u=M;h=f;return u|0}else{re=I}}while(0);I=re+1|0;a[40]=I;ne=n[re]|0;re=ne<<24>>24;if((ne<<24>>24|0)==45){if((n[I]|0)==0){p=1260}}else if((ne<<24>>24|0)==58){p=1263}else{p=1260}do{if((p|0)==1260){S=Pe(_|0,re|0)|0;if((S|0)==0){if(ne<<24>>24!=45){p=1263;break}if((n[I]|0)==0){u=-1}else{break}h=f;return u|0}T=n[S+1|0]|0;if(P&ne<<24>>24==87&T<<24>>24==59){do{if((n[I]|0)==0){M=(a[44]|0)+1|0;a[44]=M;if((M|0)<(e|0)){a[40]=a[t+(M<<2)>>2];break}a[40]=824;do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Hr(48,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=(n[_]|0)==58?58:63;h=f;return u|0}}while(0);M=Lr(t,_,i,o,0)|0;a[40]=824;u=M;h=f;return u|0}if(T<<24>>24!=58){if((n[I]|0)!=0){u=re;h=f;return u|0}a[44]=(a[44]|0)+1;u=re;h=f;return u|0}a[198]=0;do{if((n[I]|0)==0){if((n[S+2|0]|0)==58){break}M=(a[44]|0)+1|0;a[44]=M;if((M|0)<(e|0)){a[198]=a[t+(M<<2)>>2];break}a[40]=824;do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Hr(48,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=(n[_]|0)==58?58:63;h=f;return u|0}else{a[198]=I}}while(0);a[40]=824;a[44]=(a[44]|0)+1;u=re;h=f;return u|0}}while(0);do{if((p|0)==1263){if((n[I]|0)!=0){break}a[44]=(a[44]|0)+1}}while(0);do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Hr(272,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=63;h=f;return u|0}function Cr(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;return Br(e,t,r,n,i,1)|0}function Or(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;return Br(e,t,r,n,i,5)|0}function Nr(e){e=e|0;return mr(e)|0}function jr(e,t){e=e|0;t=t|0;return Nr(e)|0}function zr(){var e=0;e=Le(4)|0;a[e>>2]=560;_e(e|0,688,6)}function Lr(e,t,r,i,o){e=e|0;t=t|0;r=r|0;i=i|0;o=o|0;var s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0;s=h;f=a[40]|0;u=a[44]|0;c=u+1|0;a[44]=c;l=Pe(f|0,61)|0;if((l|0)==0){d=tn(f|0)|0;p=0}else{d=l-f|0;p=l+1|0}l=a[r>>2]|0;e:do{if((l|0)!=0){t:do{if((o|0)!=0&(d|0)==1){b=0;v=l;while(1){if((n[f]|0)==(n[v]|0)){if((tn(v|0)|0)==1){m=b;break t}}b=b+1|0;v=a[r+(b<<4)>>2]|0;if((v|0)==0){break e}}}else{v=0;b=-1;g=l;while(1){if((ge(f|0,g|0,d|0)|0)==0){if((tn(g|0)|0)==(d|0)){m=v;break t}if((b|0)==-1){y=v}else{break}}else{y=b}w=v+1|0;_=a[r+(w<<4)>>2]|0;if((_|0)==0){m=y;break t}else{v=w;b=y;g=_}}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Hr(304,(E=h,h=h+16|0,a[E>>2]=d,a[E+8>>2]=f,E)|0)}}while(0);a[42]=0;S=63;h=s;return S|0}}while(0);if((m|0)==-1){break}g=r+(m<<4)+4|0;b=a[g>>2]|0;v=(p|0)==0;if(!((b|0)!=0|v)){do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Hr(208,(E=h,h=h+16|0,a[E>>2]=d,a[E+8>>2]=f,E)|0)}}while(0);if((a[r+(m<<4)+8>>2]|0)==0){k=a[r+(m<<4)+12>>2]|0}else{k=0}a[42]=k;S=(n[t]|0)==58?58:63;h=s;return S|0}do{if((b-1|0)>>>0<2){if(!v){a[198]=p;break}if((b|0)!=1){break}a[44]=u+2;a[198]=a[e+(c<<2)>>2]}}while(0);if(!((a[g>>2]|0)==1&(a[198]|0)==0)){if((i|0)!=0){a[i>>2]=m}b=a[r+(m<<4)+8>>2]|0;v=a[r+(m<<4)+12>>2]|0;if((b|0)==0){S=v;h=s;return S|0}a[b>>2]=v;S=0;h=s;return S|0}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Hr(8,(E=h,h=h+8|0,a[E>>2]=f,E)|0)}}while(0);if((a[r+(m<<4)+8>>2]|0)==0){x=a[r+(m<<4)+12>>2]|0}else{x=0}a[42]=x;a[44]=(a[44]|0)-1;S=(n[t]|0)==58?58:63;h=s;return S|0}}while(0);if((o|0)!=0){a[44]=u;S=-1;h=s;return S|0}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Hr(248,(E=h,h=h+8|0,a[E>>2]=f,E)|0)}}while(0);a[42]=0;S=63;h=s;return S|0}function Fr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+16|0;n=r|0;i=n;a[i>>2]=t;a[i+4>>2]=0;Ur(e,n|0);h=r;return}function Hr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+16|0;n=r|0;i=n;a[i>>2]=t;a[i+4>>2]=0;Dr(e,n|0);h=r;return}function Ur(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;n=a[($e()|0)>>2]|0;i=a[w>>2]|0;xe(a[m>>2]|0,432,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;if((e|0)!=0){i=a[m>>2]|0;Ye(i|0,e|0,t|0)|0;t=a[m>>2]|0;Ce(472,2,1,t|0)|0}t=a[m>>2]|0;e=Se(n|0)|0;xe(t|0,384,(E=h,h=h+8|0,a[E>>2]=e,E)|0)|0;h=r;return}function Dr(e,t){e=e|0;t=t|0;var r=0,n=0;r=h;n=a[w>>2]|0;xe(a[m>>2]|0,376,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;if((e|0)!=0){n=a[m>>2]|0;Ye(n|0,e|0,t|0)|0}Re(10,a[m>>2]|0)|0;h=r;return}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,o=0,s=0,f=0,u=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,F=0,H=0,U=0,D=0,q=0,K=0;r=e;while(1){i=r+1|0;if((Fe(n[r]|0)|0)==0){break}else{r=i}}o=n[r]|0;if((o<<24>>24|0)==45){s=i;f=1}else if((o<<24>>24|0)==43){s=i;f=0}else{s=r;f=0}r=-1;i=0;o=s;while(1){u=n[o]|0;if(((u<<24>>24)-48|0)>>>0<10){h=r}else{if(u<<24>>24!=46|(r|0)>-1){break}else{h=i}}r=h;i=i+1|0;o=o+1|0}h=o+(-i|0)|0;s=(r|0)<0;l=((s^1)<<31>>31)+i|0;d=(l|0)>18;p=(d?-18:-l|0)+(s?i:r)|0;r=d?18:l;do{if((r|0)==0){b=e;v=0}else{if((r|0)>9){l=h;d=r;i=0;while(1){s=n[l]|0;m=l+1|0;if(s<<24>>24==46){g=n[m]|0;y=l+2|0}else{g=s;y=m}w=(i*10|0)-48+(g<<24>>24)|0;m=d-1|0;if((m|0)>9){l=y;d=m;i=w}else{break}}_=+(w|0)*1e9;S=9;k=y;x=1393}else{if((r|0)>0){_=0;S=r;k=h;x=1393}else{A=0;M=0}}if((x|0)==1393){i=k;d=S;l=0;while(1){m=n[i]|0;s=i+1|0;if(m<<24>>24==46){E=n[s]|0;I=i+2|0}else{E=m;I=s}T=(l*10|0)-48+(E<<24>>24)|0;s=d-1|0;if((s|0)>0){i=I;d=s;l=T}else{break}}A=+(T|0);M=_}P=M+A;do{if((u<<24>>24|0)==69|(u<<24>>24|0)==101){l=o+1|0;d=n[l]|0;if((d<<24>>24|0)==43){R=o+2|0;B=0}else if((d<<24>>24|0)==45){R=o+2|0;B=1}else{R=l;B=0}l=n[R]|0;if(((l<<24>>24)-48|0)>>>0<10){C=R;O=0;N=l}else{j=0;z=R;L=B;break}while(1){l=(O*10|0)-48+(N<<24>>24)|0;d=C+1|0;i=n[d]|0;if(((i<<24>>24)-48|0)>>>0<10){C=d;O=l;N=i}else{j=l;z=d;L=B;break}}}else{j=0;z=o;L=0}}while(0);d=p+((L|0)==0?j:-j|0)|0;l=(d|0)<0?-d|0:d;if((l|0)>511){a[($e()|0)>>2]=34;F=1;H=88;U=511;x=1410}else{if((l|0)==0){D=1}else{F=1;H=88;U=l;x=1410}}if((x|0)==1410){while(1){x=0;if((U&1|0)==0){q=F}else{q=F*+c[H>>3]}l=U>>1;if((l|0)==0){D=q;break}else{F=q;H=H+8|0;U=l;x=1410}}}if((d|0)>-1){b=z;v=P*D;break}else{b=z;v=P/D;break}}}while(0);if((t|0)!=0){a[t>>2]=b}if((f|0)==0){K=v;return+K}K=-0-v;return+K}function Kr(e,t){e=e|0;t=t|0;return+ +qr(e,t)}function Yr(e,t){e=e|0;t=t|0;return+ +qr(e,t)}function Vr(e,t,r){e=e|0;t=t|0;r=r|0;return+ +qr(e,t)}function Wr(e,t,r){e=e|0;t=t|0;r=r|0;return+ +qr(e,t)}function Xr(e){e=e|0;return+ +qr(e,0)}function Zr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+16|0;i=n|0;n=i;a[n>>2]=r;a[n+4>>2]=0;Qr(e,t,i|0)}function Gr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+16|0;i=n|0;n=i;a[n>>2]=r;a[n+4>>2]=0;$r(e,t,i|0)}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=a[($e()|0)>>2]|0;i=a[w>>2]|0;xe(a[m>>2]|0,336,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;if((t|0)!=0){i=a[m>>2]|0;Ye(i|0,t|0,r|0)|0;r=a[m>>2]|0;Ce(480,2,1,r|0)|0}r=a[m>>2]|0;t=Se(n|0)|0;xe(r|0,392,(E=h,h=h+8|0,a[E>>2]=t,E)|0)|0;je(e|0)}function $r(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;n=a[w>>2]|0;xe(a[m>>2]|0,440,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;if((t|0)!=0){n=a[m>>2]|0;Ye(n|0,t|0,r|0)|0}Re(10,a[m>>2]|0)|0;je(e|0)}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;i=e|0;if((e&3)==(t&3)){while(e&3){if((r|0)==0)return i|0;n[e]=n[t]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){a[e>>2]=a[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){n[e]=n[t]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function en(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,o=0,s=0;i=e+r|0;if((r|0)>=20){t=t&255;r=e&3;o=t|t<<8|t<<16|t<<24;s=i&~3;if(r){r=e+4-r|0;while((e|0)<(r|0)){n[e]=t;e=e+1|0}}while((e|0)<(s|0)){a[e>>2]=o;e=e+4|0}}while((e|0)<(i|0)){n[e]=t;e=e+1|0}}function tn(e){e=e|0;var t=0;t=e;while(n[t]|0){t=t+1|0}return t-e|0}function rn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=e+r>>>0;return(j=t+n+(i>>>0>>0|0)>>>0,i|0)|0}function nn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=t-n>>>0;i=t-n-(r>>>0>e>>>0|0)>>>0;return(j=i,e-r>>>0|0)|0}function an(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){j=t<>>32-r;return e<>>r;return e>>>r|(t&(1<>>r-32|0}function sn(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){j=t>>r;return e>>>r|(t&(1<>r-32|0}function fn(e){e=e|0;var t=0;t=n[v+(e>>>24)|0]|0;if((t|0)<8)return t|0;t=n[v+(e>>16&255)|0]|0;if((t|0)<8)return t+8|0;t=n[v+(e>>8&255)|0]|0;if((t|0)<8)return t+16|0;return(n[v+(e&255)|0]|0)+24|0}function un(e){e=e|0;var t=0;t=n[b+(e&255)|0]|0;if((t|0)<8)return t|0;t=n[b+(e>>8&255)|0]|0;if((t|0)<8)return t+8|0;t=n[b+(e>>16&255)|0]|0;if((t|0)<8)return t+16|0;return(n[b+(e>>>24)|0]|0)+24|0}function cn(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,a=0;r=e&65535;n=t&65535;i=oe(n,r)|0;a=e>>>16;e=(i>>>16)+(oe(n,a)|0)|0;n=t>>>16;t=oe(n,r)|0;return(j=(e>>>16)+(oe(n,a)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|i&65535|0)|0}function hn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,s=0,f=0;i=t>>31|((t|0)<0?-1:0)<<1;a=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=n>>31|((n|0)<0?-1:0)<<1;s=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;f=nn(i^e,a^t,i,a)|0;t=j;e=o^i;i=s^a;a=nn((vn(f,t,nn(o^r,s^n,o,s)|0,j,0)|0)^e,j^i,e,i)|0;return(j=j,a)|0}function ln(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0,s=0,f=0,u=0,c=0,l=0;i=h;h=h+8|0;o=i|0;s=t>>31|((t|0)<0?-1:0)<<1;f=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=n>>31|((n|0)<0?-1:0)<<1;c=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;l=nn(s^e,f^t,s,f)|0;t=j;e=nn(u^r,c^n,u,c)|0;vn(l,t,e,j,o)|0;e=nn(a[o>>2]^s,a[o+4>>2]^f,s,f)|0;f=j;h=i;return(j=f,e)|0}function dn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0;i=e;e=r;r=cn(i,e)|0;a=j;return(j=(oe(t,e)|0)+(oe(n,i)|0)+a|a&0,r|0|0)|0}function pn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=vn(e,t,r,n,0)|0;return(j=j,i)|0}function bn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0;i=h;h=h+8|0;o=i|0;vn(e,t,r,n,o)|0;h=i;return(j=a[o+4>>2]|0,a[o>>2]|0)|0}function vn(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;var o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,P=0,R=0,B=0,C=0,O=0,N=0,z=0,L=0;o=e;s=t;f=s;u=r;c=n;h=c;if((f|0)==0){l=(i|0)!=0;if((h|0)==0){if(l){a[i>>2]=(o>>>0)%(u>>>0);a[i+4>>2]=0}d=0;p=(o>>>0)/(u>>>0)>>>0;return(j=d,p)|0}else{if(!l){d=0;p=0;return(j=d,p)|0}a[i>>2]=e|0;a[i+4>>2]=t&0;d=0;p=0;return(j=d,p)|0}}l=(h|0)==0;do{if((u|0)==0){if(l){if((i|0)!=0){a[i>>2]=(f>>>0)%(u>>>0);a[i+4>>2]=0}d=0;p=(f>>>0)/(u>>>0)>>>0;return(j=d,p)|0}if((o|0)==0){if((i|0)!=0){a[i>>2]=0;a[i+4>>2]=(f>>>0)%(h>>>0)}d=0;p=(f>>>0)/(h>>>0)>>>0;return(j=d,p)|0}b=h-1|0;if((b&h|0)==0){if((i|0)!=0){a[i>>2]=e|0;a[i+4>>2]=b&f|t&0}d=0;p=f>>>((un(h|0)|0)>>>0);return(j=d,p)|0}b=(fn(h|0)|0)-(fn(f|0)|0)|0;if(b>>>0<=30){v=b+1|0;m=31-b|0;g=v;y=f<>>(v>>>0);w=f>>>(v>>>0);_=0;S=o<>2]=e|0;a[i+4>>2]=s|t&0;d=0;p=0;return(j=d,p)|0}else{if(!l){m=(fn(h|0)|0)-(fn(f|0)|0)|0;if(m>>>0<=31){v=m+1|0;b=31-m|0;k=m-31>>31;g=v;y=o>>>(v>>>0)&k|f<>>(v>>>0)&k;_=0;S=o<>2]=e|0;a[i+4>>2]=s|t&0;d=0;p=0;return(j=d,p)|0}b=u-1|0;if((b&u|0)!=0){k=(fn(u|0)|0)+33-(fn(f|0)|0)|0;v=64-k|0;m=32-k|0;x=m>>31;A=k-32|0;M=A>>31;g=k;y=m-1>>31&f>>>(A>>>0)|(f<>>(k>>>0))&M;w=M&f>>>(k>>>0);_=o<>>(A>>>0))&x|o<>31;break}if((i|0)!=0){a[i>>2]=b&o;a[i+4>>2]=0}if((u|0)==1){d=s|t&0;p=e|0|0;return(j=d,p)|0}else{b=un(u|0)|0;d=f>>>(b>>>0)|0;p=f<<32-b|o>>>(b>>>0)|0;return(j=d,p)|0}}}while(0);if((g|0)==0){E=S;I=_;T=w;P=y;R=0;B=0}else{o=r|0|0;r=c|n&0;n=rn(o,r,-1,-1)|0;c=j;f=S;S=_;_=w;w=y;y=g;g=0;while(1){C=S>>>31|f<<1;O=g|S<<1;u=w<<1|f>>>31|0;e=w>>>31|_<<1|0;nn(n,c,u,e)|0;t=j;s=t>>31|((t|0)<0?-1:0)<<1;N=s&1;z=nn(u,e,s&o,(((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1)&r)|0;L=j;t=y-1|0;if((t|0)==0){break}else{f=C;S=O;_=L;w=z;y=t;g=N}}E=C;I=O;T=L;P=z;R=0;B=N}N=I;I=0;if((i|0)!=0){a[i>>2]=P;a[i+4>>2]=T}d=(N|0)>>>31|(E|I)<<1|(I<<1|N>>>31)&0|R;p=(N<<1|0>>>31)&-2|B;return(j=d,p)|0}function mn(e,t){e=e|0;t=t|0;Tn[e&15](t|0)}function gn(e,t,r){e=e|0;t=t|0;r=r|0;Pn[e&15](t|0,r|0)}function yn(e,t){e=e|0;t=t|0;return Rn[e&7](t|0)|0}function wn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;Bn[e&15](t|0,r|0,n|0)}function _n(e){e=e|0;Cn[e&1]()}function Sn(e,t,r){e=e|0;t=t|0;r=r|0;return On[e&1](t|0,r|0)|0}function kn(e){e=e|0;se(0)}function xn(e,t){e=e|0;t=t|0;se(1)}function An(e){e=e|0;se(2);return 0}function Mn(e,t,r){e=e|0;t=t|0;r=r|0;se(3)}function En(){se(4)}function In(e,t){e=e|0;t=t|0;se(5);return 0}var Tn=[kn,kn,xr,kn,Pr,kn,yr,kn,kr,kn,Tr,kn,kn,kn,kn,kn];var Pn=[xn,xn,Fr,xn,Ur,xn,Hr,xn,Dr,xn,xn,xn,xn,xn,xn,xn];var Rn=[An,An,wr,An,_r,An,An,An];var Bn=[Mn,Mn,$r,Mn,Qr,Mn,Zr,Mn,Gr,Mn,Mn,Mn,Mn,Mn,Mn,Mn];var Cn=[En,En];var On=[In,In];return{_crypto_scrypt:Et,_strlen:tn,_free:Yt,_realloc:Wt,_memset:en,_malloc:Kt,_memcpy:Jr,_calloc:Vt,runPostSets:wt,stackAlloc:it,stackSave:at,stackRestore:ot,setThrew:st,setTempRet0:ct,setTempRet1:ht,setTempRet2:lt,setTempRet3:dt,setTempRet4:pt,setTempRet5:bt,setTempRet6:vt,setTempRet7:mt,setTempRet8:gt,setTempRet9:yt,dynCall_vi:mn,dynCall_vii:gn,dynCall_ii:yn,dynCall_viii:wn,dynCall_v:_n,dynCall_iii:Sn}}({Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},{abort:wa,assert:w,asmPrintInt:function(e,t){s.print("int "+e+","+t)},asmPrintFloat:function(e,t){s.print("float "+e+","+t)},min:Xc,invoke_vi:function(e,t){try{s.dynCall_vi(e,t)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_vii:function(e,t,r){try{s.dynCall_vii(e,t,r)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_ii:function(e,t){try{return s.dynCall_ii(e,t)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_viii:function(e,t,r,n){try{s.dynCall_viii(e,t,r,n)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_v:function(e){try{s.dynCall_v(e)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_iii:function(e,t,r){try{return s.dynCall_iii(e,t,r)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},_strncmp:function(e,t,r){for(var n=0;na?1:-1;n++}return 0},_llvm_va_end:aa(),_sysconf:function(e){switch(e){case 8:return 4096;case 54:case 56:case 21:case 61:case 63:case 22:case 67:case 23:case 24:case 25:case 26:case 27:case 69:case 28:case 101:case 70:case 71:case 29:case 30:case 199:case 75:case 76:case 32:case 43:case 44:case 80:case 46:case 47:case 45:case 48:case 49:case 42:case 82:case 33:case 7:case 108:case 109:case 107:case 112:case 119:case 121:return 200809;case 13:case 104:case 94:case 95:case 34:case 35:case 77:case 81:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 94:case 95:case 110:case 111:case 113:case 114:case 115:case 116:case 117:case 118:case 120:case 40:case 16:case 79:case 19:return-1;case 92:case 93:case 5:case 72:case 6:case 74:case 92:case 93:case 96:case 97:case 98:case 99:case 102:case 103:case 105:return 1;case 38:case 66:case 50:case 51:case 4:return 1024;case 15:case 64:case 41:return 32;case 55:case 37:case 17:return 2147483647;case 18:case 1:return 47839;case 59:case 57:return 99;case 68:case 58:return 2048;case 0:return 2097152;case 3:return 65536;case 14:return 32768;case 73:return 32767;case 39:return 16384;case 60:return 1e3;case 106:return 700;case 52:return 256;case 62:return 255;case 2:return 100;case 65:return 64;case 36:return 20;case 100:return 16;case 20:return 6;case 53:return 4;case 10:return 1}return M(N.A),-1},___cxa_throw:rc,_strerror:zc,_abort:function(){s.abort()},_fprintf:mc,_llvm_eh_exception:U,___cxa_free_exception:sc,_fflush:aa(),___buildEnvironment:wc,__reallyNegative:jc,_strchr:function(e,t){e--;do{e++;var r=A[e];if(r==t)return e}while(r);return 0},_fputc:Bc,___setErrNo:M,_fwrite:hc,_send:fc,_write:gc,_exit:function(e){Ac(e)},___cxa_find_matching_catch:function(e,t){-1==e&&(e=B[U.m>>2]),-1==t&&(t=B[U.m+4>>2]);var r=Array.prototype.slice.call(arguments,2);0!=t&&!pc(t)&&0==B[B[t>>2]-8>>2]&&(e=B[e>>2]);for(var n=0;n=e},__formatString:kc,___resumeException:function(e){0==B[U.m>>2]&&(B[U.m>>2]=e),g(e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.")},_llvm_uadd_with_overflow_i32:function(e,t){return e>>>=0,t>>>=0,0|(V.setTempRet0(4294967295>>0)},___cxa_does_inherit:qc,_getenv:xc,_vfprintf:function(e,t,r){return mc(e,t,B[r>>2])},___cxa_begin_catch:function(e){return oc.ta--,e},__ZSt18uncaught_exceptionv:oc,_pwrite:function(e,t,r,n){if(!(e=R[e]))return M(N.$),-1;try{return Ib(e,A,t,r,n)}catch(e){return Zb(e),-1}},___cxa_call_unexpected:function(e){s.P("Unexpected exception thrown, this is not properly supported - aborting"),za=l,g(e)},_sbrk:nc,_strerror_r:yc,___errno_location:function(){return rb},___gxx_personality_v0:aa(),___cxa_is_number_type:pc,_time:function(e){var t=Math.floor(Date.now()/1e3);return e&&(B[e>>2]=t),t},__exit:Ac,___cxa_end_catch:uc,STACKTOP:u,STACK_MAX:Ta,tempDoublePtr:qb,ABORT:za,cttz_i8:Wc,ctlz_i8:Vc,NaN:NaN,Infinity:1/0,_stderr:nb,__ZTVN10__cxxabiv120__si_class_type_infoE:ob,__ZTVN10__cxxabiv117__class_type_infoE:pb,___progname:k},I);s._crypto_scrypt=V._crypto_scrypt;var ic=s._strlen=V._strlen,tc=s._free=V._free;s._realloc=V._realloc;var tb=s._memset=V._memset,Oa=s._malloc=V._malloc,sb=s._memcpy=V._memcpy;s._calloc=V._calloc;var mb=s.runPostSets=V.runPostSets;s.dynCall_vi=V.dynCall_vi,s.dynCall_vii=V.dynCall_vii,s.dynCall_ii=V.dynCall_ii,s.dynCall_viii=V.dynCall_viii,s.dynCall_v=V.dynCall_v,s.dynCall_iii=V.dynCall_iii;var qa=function(e){return V.stackAlloc(e)},ja=function(){return V.stackSave()},ka=function(e){V.stackRestore(e)},lc;Y.Ca={},Y.D=function(e){if(-128<=e&&128>e){var t=Y.Ca[e];if(t)return t}return t=new Y(0|e,0>e?-1:0),-128<=e&&128>e&&(Y.Ca[e]=t),t},Y.p=function(e){return isNaN(e)||!isFinite(e)?Y.ZERO:e<=-Y.Ea?Y.MIN_VALUE:e+1>=Y.Ea?Y.MAX_VALUE:0>e?Y.p(-e).i():new Y(e%Y.B|0,e/Y.B|0)},Y.v=function(e,t){return new Y(e,t)},Y.k=function(e,t){0==e.length&&g(Error("number format error: empty string"));var r=t||10;if((2>r||36o?(o=Y.p(Math.pow(r,o)),i=i.multiply(o).add(Y.p(s))):(i=i.multiply(n),i=i.add(Y.p(s)))}return i},Y.ea=65536,Y.Od=16777216,Y.B=Y.ea*Y.ea,Y.Pd=Y.B/2,Y.Qd=Y.B*Y.ea,Y.eb=Y.B*Y.B,Y.Ea=Y.eb/2,Y.ZERO=Y.D(0),Y.ONE=Y.D(1),Y.Da=Y.D(-1),Y.MAX_VALUE=Y.v(-1,2147483647),Y.MIN_VALUE=Y.v(0,-2147483648),Y.cb=Y.D(16777216),q=Y.prototype,q.Z=function(){return this.j*Y.B+this.ob()},q.toString=function(e){if(e=e||10,(2>e||36a.length;)a="0"+a;n=""+a+n}},q.ob=function(){return 0<=this.h?this.h:Y.B+this.h},q.G=function(){return 0==this.j&&0==this.h},q.n=function(){return 0>this.j},q.Pa=function(){return 1==(1&this.h)},q.o=function(e){return this.j==e.j&&this.h==e.h},q.Ra=function(){return 0>this.ja(Y.cb)},q.qb=function(e){return 0>>16,n=65535&this.j,i=this.h>>>16,a=e.j>>>16,o=65535&e.j,s=e.h>>>16;return t=(65535&this.h)+(65535&e.h)+0,e=0+(t>>>16),e+=i+s,i=0+(e>>>16),i+=n+o,n=0+(i>>>16),n=n+(r+a)&65535,Y.v((65535&e)<<16|65535&t,n<<16|65535&i)},q.R=function(e){return this.add(e.i())},q.multiply=function(e){if(this.G()||e.G())return Y.ZERO;if(this.o(Y.MIN_VALUE))return e.Pa()?Y.MIN_VALUE:Y.ZERO;if(e.o(Y.MIN_VALUE))return this.Pa()?Y.MIN_VALUE:Y.ZERO;if(this.n())return e.n()?this.i().multiply(e.i()):this.i().multiply(e).i();if(e.n())return this.multiply(e.i()).i();if(this.Ra()&&e.Ra())return Y.p(this.Z()*e.Z());var t,r,n,i,a=this.j>>>16,o=65535&this.j,s=this.h>>>16,f=65535&this.h,u=e.j>>>16,c=65535&e.j,h=e.h>>>16,e=65535&e.h;return i=0+f*e,n=0+(i>>>16),n+=s*e,r=0+(n>>>16),n=(65535&n)+f*h,r+=n>>>16,n&=65535,r+=o*e,t=0+(r>>>16),r=(65535&r)+s*h,t+=r>>>16,r&=65535,r+=f*c,t+=r>>>16,r&=65535,t=t+(a*e+o*h+s*c+f*u)&65535,Y.v(n<<16|65535&i,t<<16|r)},q.F=function(e){if(e.G()&&g(Error("division by zero")),this.G())return Y.ZERO;if(this.o(Y.MIN_VALUE)){if(e.o(Y.ONE)||e.o(Y.Da))return Y.MIN_VALUE;if(e.o(Y.MIN_VALUE))return Y.ONE;var t=this.Db().F(e).shiftLeft(1);if(t.o(Y.ZERO))return e.n()?Y.ONE:Y.Da;var r=this.R(e.multiply(t));return t.add(r.F(e))}if(e.o(Y.MIN_VALUE))return Y.ZERO;if(this.n())return e.n()?this.i().F(e.i()):this.i().F(e).i();if(e.n())return this.F(e.i()).i();for(var n=Y.ZERO,r=this;r.rb(e);){for(var t=Math.max(1,Math.floor(r.Z()/e.Z())),i=Math.ceil(Math.log(t)/Math.LN2),i=48>=i?1:Math.pow(2,i-48),a=Y.p(t),o=a.multiply(e);o.n()||o.qb(r);)t-=i,a=Y.p(t),o=a.multiply(e);a.G()&&(a=Y.ONE),n=n.add(a),r=r.R(o)}return n},q.xb=function(){return Y.v(~this.h,~this.j)},q.shiftLeft=function(e){if(0==(e&=63))return this;var t=this.h;return 32>e?Y.v(t<>>32-e):Y.v(0,t<e?Y.v(this.h>>>e|t<<32-e,t>>e):Y.v(t>>e-32,0<=t?0:-1)},q=X.prototype,q.ga=function(e,t,r,n){for(var i=0,a=0;0<=--n;){var o=e*this[i++]+t[r]+a,a=Math.floor(o/67108864);t[r++]=67108863&o}return a},q.f=26,q.u=67108863,q.K=67108864,q.bb=Math.pow(2,52),q.Aa=26,q.Ba=0;var $c=[],bd,Z;for(bd=48,Z=0;9>=Z;++Z)$c[bd++]=Z;for(bd=97,Z=10;36>Z;++Z)$c[bd++]=Z;for(bd=65,Z=10;36>Z;++Z)$c[bd++]=Z;q=X.prototype,q.copyTo=function(e){for(var t=this.b-1;0<=t;--t)e[t]=this[t];e.b=this.b,e.c=this.c},q.D=function(e){this.b=1,this.c=0>e?-1:0,0e?this[0]=e+DV:this.b=0},q.k=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.nb(e,t);r=2}this.c=this.b=0;for(var n=e.length,i=p,a=0;0<=--n;){var o=8==r?255&e[n]:Zc(e,n);0>o?"-"==e.charAt(n)&&(i=l):(i=p,0==a?this[this.b++]=o:a+r>this.f?(this[this.b-1]|=(o&(1<>this.f-a):this[this.b-1]|=o<=this.f&&(a-=this.f))}8==r&&0!=(128&e[0])&&(this.c=-1,0>i|s,s=(this[r]&a)<=this.b)t.b=0;else{var n=e%this.f,i=this.f-n,a=(1<>n;for(var o=r+1;o>n;0>=this.f;if(e.b>=this.f;n+=this.c}else{for(n+=this.c;r>=this.f;n-=e.c}t.c=0>n?-1:0,-1>n?t[r++]=this.K+n:0=n.b)){var i=this.abs();if(i.b>>16)&&(f=a,u+=16),0!=(a=f>>8)&&(f=a,u+=8),0!=(a=f>>4)&&(f=a,u+=4),0!=(a=f>>2)&&(f=a,u+=2),0!=f>>1&&(u+=1),f=this.f-u,0>this.Ba:0),u=this.bb/a,a=(1<s&&X.ZERO.t(r,r)}}}},q.toString=function(e){if(0>this.c)return"-"+this.i().toString(e);if(16==e)e=4;else if(8==e)e=3;else if(2==e)e=1;else if(32==e)e=5;else{if(4!=e)return this.Fb(e);e=2}var t,r=(1<>o)&&(n=l,i="0123456789abcdefghijklmnopqrstuvwxyz".charAt(t));0<=a;)o>(o+=this.f-e)):(t=this[a]>>(o-=e)&r,0>=o&&(o+=this.f,--a)),0this.c?this.i():this},q.U=function(e){var t=this.c-e.c;if(0!=t)return t;var r=this.b,t=r-e.b;if(0!=t)return 0>this.c?-t:t;for(;0<=--r;)if(0!=(t=this[r]-e[r]))return t;return 0},X.ZERO=ad(0),X.ONE=ad(1),q=X.prototype,q.nb=function(e,t){this.D(0),t==m&&(t=10);for(var r=this.S(t),n=Math.pow(t,r),i=p,a=0,o=0,s=0;sf?"-"==e.charAt(s)&&0==this.ra()&&(i=l):(o=t*o+f,++a>=r&&(this.Ia(n),this.Ha(o),o=a=0))}0this.c?-1:0>=this.b||1==this.b&&0>=this[0]?0:1},q.Ia=function(e){this[this.b]=this.ga(e-1,this,0,this.b),++this.b,this.C()},q.Ha=function(e){var t=0;if(0!=e){for(;this.b<=t;)this[this.b++]=0;for(this[t]+=e;this[t]>=this.K;)this[t]-=this.K,++t>=this.b&&(this[this.b++]=0),++this[t]}},q.Fb=function(e){if(e==m&&(e=10),0==this.ra()||2>e||36this.c){if(1==this.b)return this[0]-this.K;if(0==this.b)return-1}else{if(1==this.b)return this[0];if(0==this.b)return 0}return(this[1]&(1<<32-this.f)-1)<>=this.f;if(e.b>=this.f;n+=this.c}else{for(n+=this.c;r>=this.f;n+=e.c}t.c=0>n?-1:0,0n&&(t[r++]=this.K+n),t.b=r,t.C()};var $={abs:function(e,t){var r=new Y(e,t),r=r.n()?r.i():r;B[qb>>2]=r.h,B[qb+4>>2]=r.j},Ka:function(){$.kb||($.kb=l,$.Xa=new X,$.Xa.k("4294967296",10),$.sa=new X,$.sa.k("18446744073709551616",10),$.xe=new X,$.ye=new X)},me:function(e,t){var r=new X;r.k(t.toString(),10);var n=new X;r.vb(n),r=new X,r.k(e.toString(),10);var i=new X;return r.fa(n,i),i},stringify:function(e,t,r){return e=new Y(e,t).toString(),r&&"-"==e[0]&&($.Ka(),r=new X,r.k(e,10),e=new X,$.sa.fa(r,e),e=e.toString(10)),e},k:function(e,t,r,n,i){$.Ka();var a=new X;a.k(e,t),e=new X,e.k(r,10),r=new X,r.k(n,10),i&&0>a.U(X.ZERO)&&(n=new X,a.fa($.sa,n),a=n),n=p,0>a.U(e)?(a=e,n=l):0>2]=a.h,B[qb+4>>2]=a.j,n&&g("range error")}};lc=$;var cd,dd;if(s.callMain=s.$d=function(e){function t(){for(var e=0;3>e;e++)n.push(0)}w(0==L,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),w(0==Wa.length,"cannot call main when preRun functions remain to be called"),e=e||[],ab||(ab=l,Va(Xa));var r=e.length+1,n=[F(J("/bin/this.program"),"i8",Ka)];t();for(var i=0;i>4&15]),t.push("0123456789abcdef"[15&e[r]]);return t.join("")}function a(e,t){var r=t||0,n=scrypt_raw._malloc(e.length+r);scrypt_raw.HEAPU8.set(e,n+r);for(var i=n;i=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),a=n(r.split("/")),o=Math.min(i.length,a.length),s=o,f=0;f=64;){var d,p,b,v,m,g=n,y=i,w=a,_=o,S=s,k=f,x=u,A=c;for(p=0;p<16;p++)b=t+4*p,h[p]=(255&e[b])<<24|(255&e[b+1])<<16|(255&e[b+2])<<8|255&e[b+3];for(p=16;p<64;p++)d=h[p-2],v=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=h[p-15],m=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,h[p]=(v+h[p-7]|0)+(m+h[p-16]|0)|0;for(p=0;p<64;p++)v=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&k^~S&x)|0)+(A+(r[p]+h[p]|0)|0)|0,m=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&y^g&w^y&w)|0,A=x,x=k,k=S,S=_+v|0,_=w,w=y,y=g,g=v+m|0;n=n+g|0,i=i+y|0,a=a+w|0,o=o+_|0,s=s+S|0,f=f+k|0,u=u+x|0,c=c+A|0,t+=64,l-=64}}var r=[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],n=1779033703,i=3144134277,a=1013904242,o=2773480762,s=1359893119,f=2600822924,u=528734635,c=1541459225,h=new Array(64);t(e);var l,d=e.length%64,p=e.length/536870912|0,b=e.length<<3,v=d<56?56:120,m=e.slice(e.length-d,e.length);for(m.push(128),l=d+1;l>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),m.push(b>>>24&255),m.push(b>>>16&255),m.push(b>>>8&255),m.push(b>>>0&255),t(m),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>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,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(e,t,r){function i(){for(var e=o-1;e>=o-4;e--){if(++s[e]<=255)return;s[e]=0}}e=e.length<=64?e:n(e);var a,o=64+t.length+4,s=new Array(o),f=new Array(64),u=[];for(a=0;a<64;a++)s[a]=54;for(a=0;a=32;)i(),u=u.concat(n(f.concat(n(s)))),r-=32;return r>0&&(i(),u=u.concat(n(f.concat(n(s))).slice(0,r))),u}function a(e,t,r,n,i){var a;for(u(e,16*(2*r-1),i,0,16),a=0;a<2*r;a++)f(e,16*a,i,16),s(i,n),u(i,0,e,t+16*a,16);for(a=0;a>>32-t}function s(e,t){u(e,0,t,0,16);for(var r=8;r>0;r-=2)t[4]^=o(t[0]+t[12],7),t[8]^=o(t[4]+t[0],9),t[12]^=o(t[8]+t[4],13),t[0]^=o(t[12]+t[8],18),t[9]^=o(t[5]+t[1],7),t[13]^=o(t[9]+t[5],9),t[1]^=o(t[13]+t[9],13),t[5]^=o(t[1]+t[13],18),t[14]^=o(t[10]+t[6],7),t[2]^=o(t[14]+t[10],9),t[6]^=o(t[2]+t[14],13),t[10]^=o(t[6]+t[2],18),t[3]^=o(t[15]+t[11],7),t[7]^=o(t[3]+t[15],9),t[11]^=o(t[7]+t[3],13),t[15]^=o(t[11]+t[7],18),t[1]^=o(t[0]+t[3],7),t[2]^=o(t[1]+t[0],9),t[3]^=o(t[2]+t[1],13),t[0]^=o(t[3]+t[2],18),t[6]^=o(t[5]+t[4],7),t[7]^=o(t[6]+t[5],9),t[4]^=o(t[7]+t[6],13),t[5]^=o(t[4]+t[7],18),t[11]^=o(t[10]+t[9],7),t[8]^=o(t[11]+t[10],9),t[9]^=o(t[8]+t[11],13),t[10]^=o(t[9]+t[8],18),t[12]^=o(t[15]+t[14],7),t[13]^=o(t[12]+t[15],9),t[14]^=o(t[13]+t[12],13),t[15]^=o(t[14]+t[13],18);for(r=0;r<16;++r)e[r]+=t[r]}function f(e,t,r,n){for(var i=0;i=256)return!1}return!0}function h(e,t){var r=parseInt(e);if(e!=r)throw new Error("invalid "+t);return r}function l(e,r,n,o,s,l,p){if(!p)throw new Error("missing callback");if(n=h(n,"N"),o=h(o,"r"),s=h(s,"p"),l=h(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>d/128/o)throw new Error("N too large");if(o>d/128/s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(!c(r))throw new Error("salt must be an array or buffer");for(var b=i(e,r,128*s*o),v=new Uint32Array(32*s*o),m=0;mB&&(t=B);for(var r=0;rB&&(t=B);for(var r=0;r>0&255),b.push(v[r]>>8&255),b.push(v[r]>>16&255),b.push(v[r]>>24&255);var m=i(e,b,l);return p(null,1,m)}C(O)};O()}var d=2147483647;e.exports=l}()}).call(t,r(34).setImmediate)},function(e,t,r){var n,i;!function(a,o){"use strict";n=o,void 0!==(i="function"==typeof n?n.call(t,r,t,e):n)&&(e.exports=i)}(0,function(){"use strict";function e(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function t(t){return"debug"===t&&(t="log"),typeof console!==s&&(void 0!==console[t]?e(console,t):void 0!==console.log?e(console,"log"):o)}function r(e,t){for(var r=0;r=0&&t<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(u=t,!1!==n&&a(t),r.call(c,t,e),typeof console===s&&t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=r.address||"",this.net=r.net||"NoNet",this.assetSymbols=r.assetSymbols?r.assetSymbols:[],this.assets={},r.assets&&Object.keys(r.assets).map(function(e){"object"===i(r.assets[e])&&t.addAsset(e,r.assets[e])}),this.tokenSymbols=r.tokenSymbols?r.tokenSymbols:[],this.tokens=r.tokens?r.tokens:{}}return a(e,[{key:"addAsset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,o.AssetBalance)();e=e.toUpperCase(),this.assetSymbols.push(e);var r=(0,o.AssetBalance)(t);return this.assets[e]=r,this}},{key:"addToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e=e.toUpperCase(),this.tokenSymbols.push(e),this.tokens[e]=new u.Fixed8(t),this}},{key:"applyTx",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=e instanceof s.Transaction?e:s.Transaction.deserialize(e);var n=this.assetSymbols,i=!0,a=!1,o=void 0;try{for(var u,c=e.inputs[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;!function(e){var r=function(t){return t.txid===e.prevHash&&t.index===e.prevIndex},i=!0,a=!1,o=void 0;try{for(var s,f=n[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var u=s.value,c=t.assets[u],h=c.unspent.findIndex(r);if(h>=0){var l=c.unspent.splice(h,1);c.spent=c.spent.concat(l);break}}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}}(h)}}catch(e){a=!0,o=e}finally{try{!i&&c.return&&c.return()}finally{if(a)throw o}}for(var l=e.hash,d=0;d=0&&o.unconfirmed.splice(u,1),o.balance=o.balance.add(i.value),o.unspent||(o.unspent=[]),o.unspent.push(s)}else o.unconfirmed||(o.unconfirmed=[]),o.unconfirmed.push(s);t.assets[a]=o}(d);return this}},{key:"confirm",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.assetSymbols[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){var a=n.value,o=this.assets[a];o.unspent=o.unspent.concat(o.unconfirmed),o.unconfirmed=[]}}catch(e){t=!0,r=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw r}}return this}},{key:"export",value:function(){return{net:this.net,address:this.address,assetSymbols:this.assetSymbols,assets:p(this.assets),tokenSymbols:this.tokenSymbols,tokens:this.tokens}}},{key:"verifyAssets",value:function(e){var t=this,r=[],n=this.assetSymbols;return n.map(function(n){var i=t.assets[n];r.push(l(e,i))}),Promise.all(r).then(function(e){return n.map(function(r,n){t.assets[r]=e[n]}),t})}},{key:Symbol.toStringTag,get:function(){return"Balance"}}],[{key:"import",value:function(t){return new e(JSON.parse(t))}}]),e}(),l=function(e,t){var r={balance:new u.Fixed8(0),spent:[],unspent:[],unconfirmed:[]};return d(e,t.unspent).then(function(e){return e.map(function(e,n){var i=t.unspent[n];e?(0!==e.value.cmp(i.value)&&(i.value=e.value),r.unspent.push(i),r.balance=r.balance.add(i.value)):r.spent.push(i)}),r})},d=function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var f=o.value;!function(t){var n=c.Query.getTxOut(t.txid,t.index).execute(e).then(function(e){var r=e.result;return r?{txid:t.txid,index:r.n,assetId:r.asset,value:new u.Fixed8(r.value)}:null});r.push(n)}(f)}}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return Promise.all(r)};t.default=h;var p=function(e){var t={};return Object.keys(e).map(function(r){var n=e[r],i={balance:n.balance.toNumber(),spent:n.spent.map(function(e){return b(e)}),unspent:n.unspent.map(function(e){return b(e)}),unconfirmed:n.unconfirmed.map(function(e){return b(e)})};t[r]=i}),t},b=function(e){return{index:e.index,txid:e.txid,value:e.value.toNumber()}}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.type=r.type||128,this.version=r.version||u.TX_VERSION.CONTRACT,this.attributes=r.attributes||[],this.inputs=r.inputs||[],this.outputs=r.outputs?r.outputs.map(function(e){return b.TransactionOutput(e)}):[],this.scripts=r.scripts||[];var n=y.getExclusive[this.type](r);Object.keys(n).map(function(e){t[e]=n[e]})}return s(e,[{key:"addOutput",value:function(e,t,r){if(3===arguments.length)this.outputs.push(b.createTransactionOutput(e,t,r));else{if("object"!==o(arguments[0]))throw new Error("Invalid input given! Give either 1 or 3 arguments!");this.outputs.push(arguments[0])}return this}},{key:"addAttribute",value:function(e,t){if("string"!=typeof t)throw new TypeError("data should be formatted as string!");return this.attributes.push({usage:e,data:t}),this}},{key:"addRemark",value:function(e){var t=(0,h.str2hexstring)(e);return this.addAttribute(d.default.Remark,t)}},{key:"calculate",value:function(e){var t=m.calculateInputs(e,this.outputs,this.gas),r=t.inputs,n=t.change;return this.inputs=r,this.outputs=this.outputs.concat(n),e.applyTx(this),S.info("Calculated the inputs required for Transaction with Balance: "+e.address),this}},{key:"serialize",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return m.serializeTransaction(this,e)}},{key:"serializeExclusiveData",value:function(){return y.serializeExclusive[this.type](this)}},{key:"sign",value:function(e){return"string"==typeof e&&(e=new f.Account(e)),m.signTransaction(this,e.privateKey),S.info("Signed Transaction with Account: "+e.label),this}},{key:Symbol.toStringTag,get:function(){return"Transaction"}},{key:"exclusiveData",get:function(){return y.getExclusive[this.type](this)}},{key:"hash",get:function(){return m.getTransactionHash(this)}}],[{key:"createClaimTx",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.claims.length)throw new Error("Useless transaction! There is no claims!");var i=new f.Account(t),a=Object.assign({type:2,version:u.TX_VERSION.CLAIM},n),o=new h.Fixed8(0);a.claims=r.claims.slice(0,255).map(function(e){return o=o.add(e.claim),{prevHash:e.txid,prevIndex:e.index}}),a.outputs=[{assetId:u.ASSET_ID.GAS,value:o,scriptHash:i.scriptHash}];var s=new e(Object.assign(a,n));return S.info("New ClaimTransaction for "+i.address),s}},{key:"createContractTx",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===r)throw new Error("Useless transaction! You are not sending anything!");var i=Object.assign({type:128,version:u.TX_VERSION.CONTRACT,outputs:r},n),a=new e(i).calculate(t);return S.info("New ContractTransaction for "+t.address),a}},{key:"createInvocationTx",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};null===r&&(r=[]);var o=Object.assign({type:209,version:u.TX_VERSION.INVOCATION,outputs:r,script:"string"==typeof n?n:(0,c.createScript)(n),gas:i},a),s=new e(o).calculate(t);return S.info("New InvocationTransaction for "+t.address),s}},{key:"deserialize",value:function(t){var r=m.deserializeTransaction(t),n=y.getExclusive[r.type](r);return new e(Object.assign(r,n))}}]),e}();t.default=k},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=void 0;var n=r(2),i=r(69),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.createScript=function(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:h.RPC_VERSION;if(i(this,e),t===h.NEO_NETWORK.MAIN?this.net=h.DEFAULT_RPC.MAIN:t===h.NEO_NETWORK.TEST?this.net=h.DEFAULT_RPC.TEST:this.net=t,this.history=[],this.version="",!c.default.valid(r))throw new Error("Invalid Version: "+r);this.version=c.default.clean(r)}return a(e,[{key:"execute",value:function(e){return this.history.push(e),p.info("RPC: "+this.net+" executing Query["+e.req.method+"]"),e.execute(this.net)}},{key:"query",value:function(e){var t=new s.default(e);return this.execute(t)}},{key:"getAccountState",value:function(e){if(!(0,f.isAddress)(e))throw new Error("Invalid address given: "+e);return this.execute(s.default.getAccountState(e)).then(function(e){return e.result})}},{key:"getAssetState",value:function(e){return this.execute(s.default.getAssetState(e)).then(function(e){return e.result})}},{key:"getBlock",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.execute(s.default.getBlock(e,t)).then(function(e){return e.result})}},{key:"getBlockHash",value:function(e){return this.execute(s.default.getBlockHash(e)).then(function(e){return e.result})}},{key:"getBestBlockHash",value:function(){return this.execute(s.default.getBestBlockHash()).then(function(e){return e.result})}},{key:"getBlockCount",value:function(){return this.execute(s.default.getBlockCount()).then(function(e){return e.result})}},{key:"getBlockSysFee",value:function(e){return this.execute(s.default.getBlockSysFee(e)).then(function(e){return e.result})}},{key:"getConnectionCount",value:function(){return this.execute(s.default.getConnectionCount()).then(function(e){return e.result})}},{key:"getContractState",value:function(e){return this.execute(s.default.getContractState(e)).then(function(e){return e.result})}},{key:"getPeers",value:function(){return this.execute(s.default.getPeers()).then(function(e){return e.result})}},{key:"getRawMemPool",value:function(){return this.execute(s.default.getRawMemPool()).then(function(e){return e.result})}},{key:"getRawTransaction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.execute(s.default.getRawTransaction(e,t)).then(function(e){return e.result})}},{key:"getStorage",value:function(e,t){return this.execute(s.default.getStorage(e,t)).then(function(e){return e.result})}},{key:"getTxOut",value:function(e,t){return this.execute(s.default.getTxOut(e,t)).then(function(e){return e.result})}},{key:"getVersion",value:function(){var e=this;return this.execute(s.default.getVersion()).then(function(t){var r=t.result.useragent.match(b)[1];return e.version=c.default.clean(r),e.version}).catch(function(t){if(t.message.includes("Method not found"))return e.version=h.RPC_VERSION,e.version;throw t})}},{key:"invoke",value:function(e,t){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invoke(e,t)).then(function(e){return e.result})}},{key:"invokeFunction",value:function(e,t,r){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invokeFunction(e,t,r)).then(function(e){return e.result})}},{key:"invokeScript",value:function(e){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invokeScript(e)).then(function(e){return e.result})}},{key:"sendRawTransaction",value:function(e){return this.execute(s.default.sendRawTransaction(e)).then(function(e){return e.result})}},{key:"submitBlock",value:function(e){return this.execute(s.default.submitBlock(e)).then(function(e){return e.result})}},{key:"validateAddress",value:function(e){return this.execute(s.default.validateAddress(e)).then(function(e){return e.result.isvalid})}},{key:Symbol.toStringTag,get:function(){return"RPC Client"}}]),e}();t.default=v},function(e,t,r){"use strict";function n(e){var t=new o(e),r=a(o.prototype.request,t);return i.extend(r,o.prototype,t),i.extend(r,t),r}var i=r(9),a=r(73),o=r(178),s=r(46),f=n(s);f.Axios=o,f.create=function(e){return n(i.merge(s,e))},f.Cancel=r(77),f.CancelToken=r(192),f.isCancel=r(76),f.all=function(e){return Promise.all(e)},f.spread=r(193),e.exports=f,e.exports.default=f},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function n(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}/*! +return e.mode.CTRGladman=function(){function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var n=e.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var f=0;f>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(3))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.CipherParams,a=r.enc,o=a.Hex,s=r.format;s.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}}}(),e.format.Hex})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(17),r(3))}(0,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,a=[],o=[],s=[],f=[],u=[],c=[],h=[],l=[],d=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=0,n=0,t=0;t<256;t++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,a[r]=i,o[i]=r;var b=e[r],v=e[b],m=e[v],g=257*e[i]^16843008*i;s[r]=g<<24|g>>>8,f[r]=g<<16|g>>>16,u[r]=g<<8|g>>>24,c[r]=g;var g=16843009*m^65537*v^257*b^16843008*r;h[i]=g<<24|g>>>8,l[i]=g<<16|g>>>16,d[i]=g<<8|g>>>24,p[i]=g,r?(r=b^e[e[e[m^b]]],n^=e[e[n]]):r=n=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=this._nRounds=r+6,i=4*(n+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(f=a[f>>>24]<<24|a[f>>>16&255]<<16|a[f>>>8&255]<<8|a[255&f]):(f=f<<8|f>>>24,f=a[f>>>24]<<24|a[f>>>16&255]<<16|a[f>>>8&255]<<8|a[255&f],f^=b[s/r|0]<<24),o[s]=o[s-r]^f}for(var u=this._invKeySchedule=[],c=0;c>>24]]^l[a[f>>>16&255]]^d[a[f>>>8&255]]^p[a[255&f]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,f,u,c,a)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,h,l,d,p,o);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var f=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p>>24]^i[c>>>16&255]^a[h>>>8&255]^o[255&l]^r[d++],v=n[c>>>24]^i[h>>>16&255]^a[l>>>8&255]^o[255&u]^r[d++],m=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[255&c]^r[d++],g=n[l>>>24]^i[u>>>16&255]^a[c>>>8&255]^o[255&h]^r[d++];u=b,c=v,h=m,l=g}var b=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^r[d++],m=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^r[d++],g=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[d++];e[t]=b,e[t+1]=v,e[t+2]=m,e[t+3]=g},keySize:8});t.AES=n._createHelper(v)}(),e.AES})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(17),r(3))}(0,function(e){return function(){function t(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>5]>>>31-i%32&1}for(var a=this._subKeys=[],o=0;o<16;o++){for(var s=a[o]=[],h=c[o],n=0;n<24;n++)s[n/6|0]|=r[(u[n]-1+h)%28]<<31-n%6,s[4+(n/6|0)]|=r[28+(u[n+24]-1+h)%28]<<31-n%6;s[0]=s[0]<<1|s[0]>>>31;for(var n=1;n<7;n++)s[n]=s[n]>>>4*(n-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var l=this._invSubKeys=[],n=0;n<16;n++)l[n]=a[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,n,i){this._lBlock=e[n],this._rBlock=e[n+1],t.call(this,4,252645135),t.call(this,16,65535),r.call(this,2,858993459),r.call(this,8,16711935),t.call(this,1,1431655765);for(var a=0;a<16;a++){for(var o=i[a],s=this._lBlock,f=this._rBlock,u=0,c=0;c<8;c++)u|=h[c][((f^o[c])&l[c])>>>0];this._lBlock=f,this._rBlock=s^u}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,t.call(this,1,1431655765),r.call(this,8,16711935),r.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),e[n]=this._lBlock,e[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=o._createHelper(d);var p=s.TripleDES=o.extend({_doReset:function(){var e=this._key,t=e.words;this._des1=d.createEncryptor(a.create(t.slice(0,2))),this._des2=d.createEncryptor(a.create(t.slice(2,4))),this._des3=d.createEncryptor(a.create(t.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});n.TripleDES=o._createHelper(p)}(),e.TripleDES})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(17),r(3))}(0,function(e){return function(){function t(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){t=(t+1)%256,r=(r+e[t])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=a.RC4=i.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var f=n[i];n[i]=n[a],n[a]=f}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=t.call(this)},keySize:8,ivSize:0});r.RC4=i._createHelper(o);var s=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)t.call(this)}});r.RC4Drop=i._createHelper(s)}(),e.RC4})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(17),r(3))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,o=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);f[r]=o^u}e[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,e[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,e[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,e[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,e[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,e[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,e[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,e[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=[],s=[],f=[],u=a.Rabbit=i.extend({_doReset:function(){for(var e=this._key.words,r=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var n=0;n<4;n++)t.call(this);for(var n=0;n<8;n++)a[n]^=i[n+4&7];if(r){var o=r.words,s=o[0],f=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=u>>>16|4294901760&c,l=c<<16|65535&u;a[0]^=u,a[1]^=h,a[2]^=c,a[3]^=l,a[4]^=u,a[5]^=h,a[6]^=c,a[7]^=l;for(var n=0;n<4;n++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[r+i]^=o[i]},blockSize:4,ivSize:2});r.Rabbit=i._createHelper(u)}(),e.Rabbit})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(19),r(20),r(17),r(3))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,o=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);f[r]=o^u}e[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,e[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,e[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,e[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,e[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,e[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,e[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,e[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=e,n=r.lib,i=n.StreamCipher,a=r.algo,o=[],s=[],f=[],u=a.RabbitLegacy=i.extend({_doReset:function(){var e=this._key.words,r=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var a=0;a<4;a++)t.call(this);for(var a=0;a<8;a++)i[a]^=n[a+4&7];if(r){var o=r.words,s=o[0],f=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=u>>>16|4294901760&c,l=c<<16|65535&u;i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=l,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=l;for(var a=0;a<4;a++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[r+i]^=o[i]},blockSize:4,ivSize:2});r.RabbitLegacy=i._createHelper(u)}(),e.RabbitLegacy})},function(e,t,r){var n;!function(i){"use strict";function a(e){function t(e,n){var i,a,o,s,f,u,c=this;if(!(c instanceof t))return new t(e,n);if(null!=n&&K(n,2,64,O,"base")){if(n|=0,u=e+"",10==n)return c=new t(e instanceof t?e:u),P(c,z+c.e+1,L);if((s="number"==typeof e)&&0*e!=0||!new RegExp("^-?"+(i="["+S.slice(0,n)+"]+")+"(?:\\."+i+")?$",n<37?"i":"").test(u))return C(c,u,s,n);s?(c.s=1/e<0?(u=u.slice(1),-1):1,q&&u.replace(/^0\.0*|\./,"").length>15&&R(O,_,e),s=!1):c.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=r(u,10,n,c.s)}else{if(e instanceof t)return c.s=e.s,c.e=e.e,c.c=(e=e.c)?e.slice():e,void(O=0);if((s="number"==typeof e)&&0*e==0){if(c.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,o=e;o>=10;o/=10,a++);return c.e=a,c.c=[e],void(O=0)}u=e+""}else{if(!v.test(u=e+""))return C(c,u,s);c.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((a=u.indexOf("."))>-1&&(u=u.replace(".","")),(o=u.search(/e/i))>0?(a<0&&(a=o),a+=+u.slice(o+1),u=u.substring(0,o)):a<0&&(a=u.length),o=0;48===u.charCodeAt(o);o++);for(f=u.length;48===u.charCodeAt(--f););if(u=u.slice(o,f+1))if(f=u.length,s&&q&&f>15&&(e>A||e!==g(e))&&R(O,_,c.s*e),(a=a-o-1)>D)c.c=c.e=null;else if(a=0&&(f=W,W=0,e=e.replace(".",""),p=new t(n),c=p.pow(e.length-b),W=f,p.c=h(d(s(c.c),c.e),10,r),p.e=p.c.length),l=h(e,n,r),o=f=l.length;0==l[--f];l.pop());if(!l[0])return"0";if(b<0?--o:(c.c=l,c.e=o,c.s=i,c=B(c,p,v,m,r),l=c.c,u=c.r,o=c.e),a=o+v+1,b=l[a],f=r/2,u=u||a<0||null!=l[a+1],u=m<4?(null!=b||u)&&(0==m||m==(c.s<0?3:2)):b>f||b==f&&(4==m||u||6==m&&1&l[a-1]||m==(c.s<0?8:7)),a<1||!l[0])e=u?d("1",-v):"0";else{if(l.length=a,u)for(--r;++l[--a]>r;)l[a]=0,a||(++o,l=[1].concat(l));for(f=l.length;!l[--f];);for(b=0,e="";b<=f;e+=S.charAt(l[b++]));e=d(e,o)}return e}function n(e,r,n,i){var a,o,f,u,c;if(n=null!=n&&K(n,0,8,i,w)?0|n:L,!e.c)return e.toString();if(a=e.c[0],f=e.e,null==r)c=s(e.c),c=19==i||24==i&&f<=H?l(c,f):d(c,f);else if(e=P(new t(e),r,n),o=e.e,c=s(e.c),u=c.length,19==i||24==i&&(r<=o||o<=H)){for(;uu){if(--r>0)for(c+=".";r--;c+="0");}else if((r+=o-u)>0)for(o+1==u&&(c+=".");r--;c+="0");return e.s<0&&a?"-"+c:c}function i(e,r){var n,i,a=0;for(c(e[0])&&(e=e[0]),n=new t(e[0]);++ar||e!=p(e))&&R(n,(i||"decimal places")+(er?" out of range":" not an integer"),e),!0}function T(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*x-1)>D?e.c=e.e=null:r=10;s/=10,i++);if((a=t-i)<0)a+=x,o=t,f=h[u=0],c=f/l[i-o-1]%10|0;else if((u=m((a+1)/x))>=h.length){if(!n)break e;for(;h.length<=u;h.push(0));f=c=0,i=1,a%=x,o=a-x+1}else{for(f=s=h[u],i=1;s>=10;s/=10,i++);a%=x,o=a-x+i,c=o<0?0:f/l[i-o-1]%10|0}if(n=n||t<0||null!=h[u+1]||(o<0?f:f%l[i-o-1]),n=r<4?(c||n)&&(0==r||r==(e.s<0?3:2)):c>5||5==c&&(4==r||n||6==r&&(a>0?o>0?f/l[i-o]:0:h[u-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,n?(t-=e.e+1,h[0]=l[(x-t%x)%x],e.e=-t||0):h[0]=e.e=0,e;if(0==a?(h.length=u,s=1,u--):(h.length=u+1,s=l[x-a],h[u]=o>0?g(f/l[i-o]%l[o])*s:0),n)for(;;){if(0==u){for(a=1,o=h[0];o>=10;o/=10,a++);for(o=h[0]+=s,s=1;o>=10;o/=10,s++);a!=s&&(e.e++,h[0]==k&&(h[0]=1));break}if(h[u]+=s,h[u]!=k)break;h[u--]=0,s=1}for(a=h.length;0===h[--a];h.pop());}e.e>D?e.c=e.e=null:e.er)return null!=(e=i[r++])};return o(t="DECIMAL_PLACES")&&K(e,0,I,2,t)&&(z=0|e),n[t]=z,o(t="ROUNDING_MODE")&&K(e,0,8,2,t)&&(L=0|e),n[t]=L,o(t="EXPONENTIAL_AT")&&(c(e)?K(e[0],-I,0,2,t)&&K(e[1],0,I,2,t)&&(H=0|e[0],F=0|e[1]):K(e,-I,I,2,t)&&(H=-(F=0|(e<0?-e:e)))),n[t]=[H,F],o(t="RANGE")&&(c(e)?K(e[0],-I,-1,2,t)&&K(e[1],1,I,2,t)&&(U=0|e[0],D=0|e[1]):K(e,-I,I,2,t)&&(0|e?U=-(D=0|(e<0?-e:e)):q&&R(2,t+" cannot be zero",e))),n[t]=[U,D],o(t="ERRORS")&&(e===!!e||1===e||0===e?(O=0,K=(q=!!e)?b:u):q&&R(2,t+y,e)),n[t]=q,o(t="CRYPTO")&&(!0===e||!1===e||1===e||0===e?e?(e="undefined"==typeof crypto,!e&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?Y=!0:q?R(2,"crypto unavailable",e?void 0:crypto):Y=!1):Y=!1:q&&R(2,t+y,e)),n[t]=Y,o(t="MODULO_MODE")&&K(e,0,9,2,t)&&(V=0|e),n[t]=V,o(t="POW_PRECISION")&&K(e,0,I,2,t)&&(W=0|e),n[t]=W,o(t="FORMAT")&&("object"==typeof e?X=e:q&&R(2,t+" not an object",e)),n[t]=X,n},t.max=function(){return i(arguments,N.lt)},t.min=function(){return i(arguments,N.gt)},t.random=function(){var e=9007199254740992*Math.random()&2097151?function(){return g(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(r){var n,i,a,o,s,f=0,u=[],c=new t(j);if(r=null!=r&&K(r,0,I,14)?0|r:z,o=m(r/x),Y)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(o*=2));f>>11),s>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),n[f]=i[0],n[f+1]=i[1]):(u.push(s%1e14),f+=2);f=o/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(o*=7);f=9e15?crypto.randomBytes(7).copy(n,f):(u.push(s%1e14),f+=7);f=o/7}else Y=!1,q&&R(14,"crypto unavailable",crypto);if(!Y)for(;f=10;s/=10,f++);fn?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(i,a,s,f,u){var c,h,l,d,p,b,v,m,y,w,_,S,A,M,E,I,T,R=i.s==a.s?1:-1,B=i.c,C=a.c;if(!(B&&B[0]&&C&&C[0]))return new t(i.s&&a.s&&(B?!C||B[0]!=C[0]:C)?B&&0==B[0]||!C?0*R:R/0:NaN);for(m=new t(R),y=m.c=[],h=i.e-a.e,R=s+h+1,u||(u=k,h=o(i.e/x)-o(a.e/x),R=R/x|0),l=0;C[l]==(B[l]||0);l++);if(C[l]>(B[l]||0)&&h--,R<0)y.push(1),d=!0;else{for(M=B.length,I=C.length,l=0,R+=2,p=g(u/(C[0]+1)),p>1&&(C=e(C,p,u),B=e(B,p,u),I=C.length,M=B.length),A=I,w=B.slice(0,I),_=w.length;_=u/2&&E++;do{if(p=0,(c=r(C,w,I,_))<0){if(S=w[0],I!=_&&(S=S*u+(w[1]||0)),(p=g(S/E))>1)for(p>=u&&(p=u-1),b=e(C,p,u),v=b.length,_=w.length;1==r(b,w,v,_);)p--,n(b,I=10;R/=10,l++);P(m,s+(m.e=l+h*x-1)+1,f,d)}else m.e=h,m.r=+d;return m}}(),C=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,n=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,f,u){var c,h=f?s:s.replace(a,"");if(i.test(h))o.s=isNaN(h)?null:h<0?-1:1;else{if(!f&&(h=h.replace(e,function(e,t,r){return c="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=c?e:t}),u&&(c=u,h=h.replace(r,"$1").replace(n,"0.$1")),s!=h))return new t(h,c);q&&R(O,"not a"+(u?" base "+u:"")+" number",s),o.s=null}o.c=o.e=null,O=0}}(),N.absoluteValue=N.abs=function(){var e=new t(this);return e.s<0&&(e.s=1),e},N.ceil=function(){return P(new t(this),this.e+1,2)},N.comparedTo=N.cmp=function(e,r){return O=1,f(this,new t(e,r))},N.decimalPlaces=N.dp=function(){var e,t,r=this.c;if(!r)return null;if(e=((t=r.length-1)-o(this.e/x))*x,t=r[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},N.dividedBy=N.div=function(e,r){return O=3,B(this,new t(e,r),z,L)},N.dividedToIntegerBy=N.divToInt=function(e,r){return O=4,B(this,new t(e,r),0,1)},N.equals=N.eq=function(e,r){return O=5,0===f(this,new t(e,r))},N.floor=function(){return P(new t(this),this.e+1,3)},N.greaterThan=N.gt=function(e,r){return O=6,f(this,new t(e,r))>0},N.greaterThanOrEqualTo=N.gte=function(e,r){return O=7,1===(r=f(this,new t(e,r)))||0===r},N.isFinite=function(){return!!this.c},N.isInteger=N.isInt=function(){return!!this.c&&o(this.e/x)>this.c.length-2},N.isNaN=function(){return!this.s},N.isNegative=N.isNeg=function(){return this.s<0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.lessThan=N.lt=function(e,r){return O=8,f(this,new t(e,r))<0},N.lessThanOrEqualTo=N.lte=function(e,r){return O=9,-1===(r=f(this,new t(e,r)))||0===r},N.minus=N.sub=function(e,r){var n,i,a,s,f=this,u=f.s;if(O=10,e=new t(e,r),r=e.s,!u||!r)return new t(NaN);if(u!=r)return e.s=-r,f.plus(e);var c=f.e/x,h=e.e/x,l=f.c,d=e.c;if(!c||!h){if(!l||!d)return l?(e.s=-r,e):new t(d?f:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-r,e):new t(l[0]?f:3==L?-0:0)}if(c=o(c),h=o(h),l=l.slice(),u=c-h){for((s=u<0)?(u=-u,a=l):(h=c,a=d),a.reverse(),r=u;r--;a.push(0));a.reverse()}else for(i=(s=(u=l.length)<(r=d.length))?u:r,u=r=0;r0)for(;r--;l[n++]=0);for(r=k-1;i>u;){if(l[--i]0?(f=s,n=c):(a=-a,n=u),n.reverse();a--;n.push(0));n.reverse()}for(a=u.length,r=c.length,a-r<0&&(n=c,c=u,u=n,r=a),a=0;r;)a=(u[--r]=u[r]+c[r]+a)/k|0,u[r]=k===u[r]?0:u[r]%k;return a&&(u=[a].concat(u),++f),T(e,u,f)},N.precision=N.sd=function(e){var t,r,n=this,i=n.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(q&&R(13,"argument"+y,e),e!=!!e&&(e=null)),!i)return null;if(r=i.length-1,t=r*x+1,r=i[r]){for(;r%10==0;r/=10,t--);for(r=i[0];r>=10;r/=10,t++);}return e&&n.e+1>t&&(t=n.e+1),t},N.round=function(e,r){var n=new t(this);return(null==e||K(e,0,I,15))&&P(n,~~e+this.e+1,null!=r&&K(r,0,8,15,w)?0|r:L),n},N.shift=function(e){var r=this;return K(e,-A,A,16,"argument")?r.times("1e"+p(e)):new t(r.c&&r.c[0]&&(e<-A||e>A)?r.s*(e<0?0:1/0):r)},N.squareRoot=N.sqrt=function(){var e,r,n,i,a,f=this,u=f.c,c=f.s,h=f.e,l=z+4,d=new t("0.5");if(1!==c||!u||!u[0])return new t(!c||c<0&&(!u||u[0])?NaN:u?f:1/0);if(c=Math.sqrt(+f),0==c||c==1/0?(r=s(u),(r.length+h)%2==0&&(r+="0"),c=Math.sqrt(r),h=o((h+1)/2)-(h<0||h%2),c==1/0?r="1e"+h:(r=c.toExponential(),r=r.slice(0,r.indexOf("e")+1)+h),n=new t(r)):n=new t(c+""),n.c[0])for(h=n.e,c=h+l,c<3&&(c=0);;)if(a=n,n=d.times(a.plus(B(f,a,l,1))),s(a.c).slice(0,c)===(r=s(n.c)).slice(0,c)){if(n.e=0;){for(n=0,p=_[a]%g,b=_[a]/g|0,f=c,s=a+f;s>a;)h=w[--f]%g,l=w[f]/g|0,u=b*h+l*p,h=p*h+u%g*g+v[s]+n,n=(h/m|0)+(u/g|0)+b*l,v[s--]=h%m;v[s]=n}return n?++i:v.splice(0,1),T(e,v,i)},N.toDigits=function(e,r){var n=new t(this);return e=null!=e&&K(e,1,I,18,"precision")?0|e:null,r=null!=r&&K(r,0,8,18,w)?0|r:L,e?P(n,e,r):n},N.toExponential=function(e,t){return n(this,null!=e&&K(e,0,I,19)?1+~~e:null,t,19)},N.toFixed=function(e,t){return n(this,null!=e&&K(e,0,I,20)?~~e+this.e+1:null,t,20)},N.toFormat=function(e,t){var r=n(this,null!=e&&K(e,0,I,21)?~~e+this.e+1:null,t,21);if(this.c){var i,a=r.split("."),o=+X.groupSize,s=+X.secondaryGroupSize,f=X.groupSeparator,u=a[0],c=a[1],h=this.s<0,l=h?u.slice(1):u,d=l.length;if(s&&(i=o,o=s,s=i,d-=i),o>0&&d>0){for(i=d%o||o,u=l.substr(0,i);i0&&(u+=f+l.slice(i)),h&&(u="-"+u)}r=c?u+X.decimalSeparator+((s=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return r},N.toFraction=function(e){var r,n,i,a,o,f,u,c,h,l=q,d=this,p=d.c,b=new t(j),v=n=new t(j),m=u=new t(j);if(null!=e&&(q=!1,f=new t(e),q=l,(l=f.isInt())&&!f.lt(j)||(q&&R(22,"max denominator "+(l?"out of range":"not an integer"),e),e=!l&&f.c&&P(f,f.e+1,1).gte(j)?f:null)),!p)return d.toString();for(h=s(p),a=b.e=h.length-d.e-1,b.c[0]=M[(o=a%x)<0?x+o:o],e=!e||f.cmp(b)>0?a>0?b:v:f,o=D,D=1/0,f=new t(h),u.c[0]=0;c=B(f,b,0,1),i=n.plus(c.times(m)),1!=i.cmp(e);)n=m,m=i,v=u.plus(c.times(i=v)),u=i,b=f.minus(c.times(i=b)),f=i;return i=B(e.minus(n),m,0,1),u=u.plus(i.times(v)),n=n.plus(i.times(m)),u.s=v.s=d.s,a*=2,r=B(v,m,a,L).minus(d).abs().cmp(B(u,n,a,L).minus(d).abs())<1?[v.toString(),m.toString()]:[u.toString(),n.toString()],D=o,r},N.toNumber=function(){return+this},N.toPower=N.pow=function(e,r){var n,i,a,o=g(e<0?-e:+e),s=this;if(null!=r&&(O=23,r=new t(r)),!K(e,-A,A,23,"exponent")&&(!isFinite(e)||o>A&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return n=Math.pow(+s,e),new t(r?n%r:n);for(r?e>1&&s.gt(j)&&s.isInt()&&r.gt(j)&&r.isInt()?s=s.mod(r):(a=r,r=null):W&&(n=m(W/x+2)),i=new t(j);;){if(o%2){if(i=i.times(s),!i.c)break;n?i.c.length>n&&(i.c.length=n):r&&(i=i.mod(r))}if(!(o=g(o/2)))break;s=s.times(s),n?s.c&&s.c.length>n&&(s.c.length=n):r&&(s=s.mod(r))}return r?i:(e<0&&(i=j.div(i)),a?i.mod(a):n?P(i,W,L):i)},N.toPrecision=function(e,t){return n(this,null!=e&&K(e,1,I,24,"precision")?0|e:null,t,24)},N.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(t=s(n.c),t=null!=e&&K(e,2,64,25,"base")?r(d(t,a),0|e,10,i):a<=H||a>=F?l(t,a):d(t,a),i<0&&n.c[0]&&(t="-"+t)),t},N.truncated=N.trunc=function(){return P(new t(this),this.e+1,1)},N.valueOf=N.toJSON=function(){var e,t=this,r=t.e;return null===r?t.toString():(e=s(t.c),e=r<=H||r>=F?l(e,r):d(e,r),t.s<0?"-"+e:e)},N.isBigNumber=!0,null!=e&&t.config(e),t}function o(e){var t=0|e;return e>0||e===t?t:t-1}function s(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nu^r?1:-1;for(s=(f=i.length)<(u=a.length)?f:u,o=0;oa[o]^r?1:-1;return f==u?0:f>u^r?1:-1}function u(e,t,r){return(e=p(e))>=t&&e<=r}function c(e){return"[object Array]"==Object.prototype.toString.call(e)}function h(e,t,r){for(var n,i,a=[0],o=0,s=e.length;or-1&&(null==a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}function l(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function d(e,t){var r,n;if(t<0){for(n="0.";++t;n+="0");e=n+e}else if(r=e.length,++t>r){for(n="0",t-=r;--t;n+="0");e+=n}else t=e)&&(n=e-1,console.error("invalid priority: "+a+" must be between 0 and "+n))),t[n].push(r)},n.dequeue=function(e){var r,n=null,a=t.length;for(i=null,r=0;ro.length);e+=1)a=l[e].timeout,s>=a&&(g("removeIdle() destroying obj - now:"+s+" timeout:"+a,"verbose"),o.push(l[e].obj));for(e=0,n=o.length;e0?(g("availableObjects.length="+r,"verbose"),i()):g("removeIdle() all objects removed","verbose")}function i(){b||(b=!0,v=setTimeout(n,c))}function a(){var e=null,r=d.size();if(g("dispense() clients="+r+" available="+l.length,"info"),r>0){for(;l.length>0;){if(g("dispense() - reusing obj","verbose"),e=l[0],t.validate(e.obj))return l.shift(),d.dequeue()(null,e.obj);f.destroy(e.obj)}p1?(t=arguments[0],r=arguments[1]):(t=arguments[0]instanceof Error?arguments[0]:null,r=arguments[0]instanceof Error?null:arguments[0]),t?(p-=1,n&&n(t,r),e.nextTick(function(){a()})):n?n(t,r):f.release(r)})}function s(){var e,r;if(!m&&p0?setTimeout(t,100):l.length!=p?setTimeout(t,100):e&&e()};t()},f.destroyAllNow=function(e){g("force destroying all objects","info");var t=l;l=[];for(var r=t.shift();null!==r&&void 0!==r;)f.destroy(r.obj),r=t.shift();b=!1,clearTimeout(v),e&&e()},f.pooled=function(e,t){return function(){var r=arguments,n=r[r.length-1],i="function"==typeof n;f.acquire(function(t,a){if(t)return void(i&&n(t));var o=[a].concat(Array.prototype.slice.call(r,0,i?-1:void 0));o.push(function(){f.release(a),i&&n.apply(null,arguments)}),e.apply(null,o)},t)}},f.getPoolSize=function(){return p},f.getName=function(){return t.name},f.availableObjectsCount=function(){return l.length},f.waitingClientsCount=function(){return d.size()},s(),f}}).call(t,r(10))},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,r){(function(t){var n=r(166),i=r(67);e.exports=function(e,r,a){for(var o=i.apply(null,arguments),s=n(o.options.maxmem),f=Array.prototype.slice.apply(o.password),r=Array.prototype.slice.apply(o.salt),u=s.crypto_scrypt(f,r,o.options.cost,o.options.blockSize,o.options.parallel,o.options.size),c=new t(u.length),h=0;hr?String.fromCharCode(r):(e.push(r),t=191r?1:2,"");if(0r?String.fromCharCode((31&r)<<6|63&n):String.fromCharCode((15&r)<<12|(63&n)<<6|63&i);return e.length=0,r},this.yb=function(e){for(var e=unescape(encodeURIComponent(e)),t=[],r=0;r>3<<3,t}function ra(e){var t=sa;return sa=sa+e|0,sa=sa+7>>3<<3,t}function ua(e){var t=z;return z=z+e|0,z=z+7>>3<<3,z>=va&&wa("Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value, or (2) set Module.TOTAL_MEMORY before the program runs."),t}function xa(e,t){return Math.ceil(e/(t||8))*(t||8)}function w(e,t){e||wa("Assertion failed: "+t)}function Ca(a){try{var b=s["_"+a];b||(b=eval("_"+a))}catch(e){}return w(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function Ba(e,t,r,n){function i(e,t){if("string"==t){if(e===m||e===k||0===e)return 0;a||(a=ja());var r=qa(e.length+1);return Da(e,r),r}return"array"==t?(a||(a=ja()),r=qa(e.length),Ea(e,r),r):e}var a=0,o=0,n=n?n.map(function(e){return i(e,r[o++])}):[];return e=e.apply(m,n),"string"==t?t=Fa(e):(w("array"!=t),t=e),a&&ka(a),t}function Ga(e,t,r){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":A[e]=t;break;case"i16":Ha[e>>1]=t;break;case"i32":B[e>>2]=t;break;case"i64":Aa=[t>>>0,(0|Math.min(+Math.floor(t/4294967296),4294967295))>>>0],B[e>>2]=Aa[0],B[e+4>>2]=Aa[1];break;case"float":Ia[e>>2]=t;break;case"double":Ja[e>>3]=t;break;default:wa("invalid type for setValue: "+r)}}function F(e,t,r,n){var i,a;"number"==typeof e?(i=l,a=e):(i=p,a=e.length);var o="string"==typeof t?t:m,r=r==Na?n:[Oa,qa,ra,ua][r===k?E:r](Math.max(a,o?1:t.length));if(i){for(n=r,w(0==(3&r)),e=r+(-4&a);n>2]=0;for(e=r+a;n=t?2*Math.abs(1<=e)return e;var r=32>=t?Math.abs(1<=r&&(32>=t||e>r)&&(e=-2*r+e),e}function ib(e){L++,s.monitorRunDependencies&&s.monitorRunDependencies(L),e?(w(!fb[e]),fb[e]=1):s.P("warning: run dependency added without ID")}function jb(e){L--,s.monitorRunDependencies&&s.monitorRunDependencies(L),e?(w(fb[e]),delete fb[e]):s.P("warning: run dependency removed without ID"),0==L&&(hb!==m&&(clearInterval(hb),hb=m),!gb&&kb&&lb())}function M(e){return B[rb>>2]=e}function vb(e,t,r){var n=O(e,{parent:l}).d,e="/"===e?"/":wb(e)[2],i=xb(n,e);return i&&g(new Q(i)),n.l.Ta||g(new Q(N.L)),n.l.Ta(n,e,t,r)}function yb(e,t){return t=4095&t|32768,vb(e,t,0)}function zb(e,t){return t=1023&t|16384,vb(e,t,0)}function Ab(e,t,r){return vb(e,8192|t,r)}function Bb(e,t){var r=O(t,{parent:l}).d,n="/"===t?"/":wb(t)[2],i=xb(r,n);return i&&g(new Q(i)),r.l.Wa||g(new Q(N.L)),r.l.Wa(r,n,e)}function Cb(e,t){var r;r="string"==typeof e?O(e,{N:l}).d:e,r.l.Y||g(new Q(N.L)),r.l.Y(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function Db(e,t){var r,n,e=Eb(e);"string"==typeof t?void 0===(n=Fb[t])&&g(Error("Unknown file open mode: "+t)):n=t,t=n,r=512&t?4095&r|32768:0;var i;try{var a=O(e,{N:!(65536&t)});i=a.d,e=a.path}catch(e){}512&t&&(i?2048&t&&g(new Q(N.va)):i=vb(e,r,0)),i||g(new Q(N.ca)),8192==(61440&i.mode)&&(t&=-1025),i?40960==(61440&i.mode)?r=N.ba:16384==(61440&i.mode)&&(0!=(3&t)||1024&t)?r=N.aa:(r=["r","w","rw"][3&t],1024&t&&(r+="w"),r=Gb(i,r)):r=N.ca,r&&g(new Q(r)),1024&t&&(r=i,r="string"==typeof r?O(r,{N:l}).d:r,r.l.Y||g(new Q(N.L)),16384==(61440&r.mode)&&g(new Q(N.aa)),32768!=(61440&r.mode)&&g(new Q(N.A)),(a=Gb(r,"w"))&&g(new Q(a)),r.l.Y(r,{size:0,timestamp:Date.now()}));var o,s={path:e,d:i,M:t,seekable:l,position:0,e:i.e,Gb:[],error:p};e:{for(i=k||4096,r=k||1;r<=i;r++)if(!R[r]){o=r;break e}g(new Q(N.Za))}return s.s=o,Object.defineProperty(s,"object",{get:function(){return s.d},set:function(e){s.d=e}}),Object.defineProperty(s,"isRead",{get:function(){return 1!=(3&s.M)}}),Object.defineProperty(s,"isWrite",{get:function(){return 0!=(3&s.M)}}),Object.defineProperty(s,"isAppend",{get:function(){return 8&s.M}}),R[o]=s,s.e.open&&s.e.open(s),s}function Hb(e){try{e.e.close&&e.e.close(e)}catch(e){g(e)}finally{R[e.s]=m}}function Ib(e,t,r,n,i){(0>n||0>i)&&g(new Q(N.A)),0==(3&e.M)&&g(new Q(N.$)),16384==(61440&e.d.mode)&&g(new Q(N.aa)),e.e.write||g(new Q(N.A));var a=l;return void 0===i?(i=e.position,a=p):e.seekable||g(new Q(N.da)),8&e.M&&((!e.seekable||!e.e.na)&&g(new Q(N.da)),e.e.na(e,0,2)),t=e.e.write(e,t,r,n,i),a||(e.position+=t),t}function wb(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)}function Jb(e,t){for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function Eb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1),e=Jb(e.split("/").filter(function(e){return!!e}),!t).join("/");return!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function S(){return Eb(Array.prototype.slice.call(arguments,0).filter(function(e){return"string"!=typeof e&&g(new TypeError("Arguments to path.join must be strings")),e}).join("/"))}function Kb(){for(var e="",t=p,r=arguments.length-1;-1<=r&&!t;r--){var n=0<=r?arguments[r]:"/";"string"!=typeof n&&g(new TypeError("Arguments to path.resolve must be strings")),n&&(e=n+"/"+e,t="/"===n.charAt(0))}return e=Jb(e.split("/").filter(function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."}function Mb(e,t){Lb[e]={input:[],H:[],O:t},Nb[e]={e:Ob}}function Q(e){this.mb=e;for(var t in N)if(N[t]===e){this.code=t;break}this.message=ub[e]}function Zb(e){e instanceof Q||g(e+" : "+Error().stack),M(e.mb)}function $b(e,t){for(var r=0,n=0;ne||0===e&&-1/0==1/e}function kc(e,t){function r(e){var r;return"double"===e?r=Ja[t+o>>3]:"i64"==e?(r=[B[t+o>>2],B[t+(o+8)>>2]],o+=8):(e="i32",r=B[t+o>>2]),o+=Math.max(Math.max(la(e),ma),8),r}for(var n,i,a=e,o=0,s=[];;){var f=a;if(0===(n=A[a]))break;if(i=A[a+1|0],37==n){var u=p,c=p,h=p,d=p;e:for(;;){switch(i){case 43:u=l;break;case 45:c=l;break;case 35:h=l;break;case 48:if(d)break e;d=l;break;default:break e}a++,i=A[a+1|0]}var b=0;if(42==i)b=r("i32"),a++,i=A[a+1|0];else for(;48<=i&&57>=i;)b=10*b+(i-48),a++,i=A[a+1|0];var v=p;if(46==i){var g=0,v=l;if(a++,42==(i=A[a+1|0]))g=r("i32"),a++;else for(;!(48>(i=A[a+1|0])||57>>0)+4294967296*+(n[1]>>>0):+(n[0]>>>0)+4294967296*+(0|n[1])),4>=y&&(n=(f?eb:db)(n&Math.pow(256,y)-1,8*y));var S=Math.abs(n),f="";if(100==i||105==i)w=8==y&&lc?lc.stringify(_[0],_[1],m):eb(n,8*y).toString(10);else if(117==i)w=8==y&&lc?lc.stringify(_[0],_[1],l):db(n,8*y).toString(10),n=Math.abs(n);else if(111==i)w=(h?"0":"")+S.toString(8);else if(120==i||88==i){if(f=h&&0!=n?"0x":"",8==y&&lc)if(_[1]){for(w=(_[1]>>>0).toString(16),h=(_[0]>>>0).toString(16);8>h.length;)h="0"+h;w+=h}else w=(_[0]>>>0).toString(16);else if(0>n){for(n=-n,w=(S-1).toString(16),_=[],h=0;hn?"-"+f:"+"+f);f.length+w.lengthy&&-4<=y?(i=(103==i?"f":"F").charCodeAt(0),g-=y+1):(i=(103==i?"e":"E").charCodeAt(0),g--),y=Math.min(g,20)),101==i||69==i?(w=n.toExponential(y),/[eE][-+]\d$/.test(w)&&(w=w.slice(0,-1)+"0"+w.slice(-1))):102!=i&&70!=i||(w=n.toFixed(y),0===n&&jc(n)&&(w="-"+w)),f=w.split("e"),v&&!h)for(;1y++;)f[0]+="0";w=f[0]+(1n?"-":"")+"inf",d=p;for(;w.lengthi&&(w=w.toUpperCase()),w.split("").forEach(function(e){s.push(e.charCodeAt(0))});break;case"s":if(d=(u=r("i8*"))?ic(u):6,v&&(d=Math.min(d,g)),!c)for(;d>2]=s.length;break;case"%":s.push(n);break;default:for(h=f;h>12<<12,nc.ia=l,w(ua),nc.hb=ua,ua=function(){wa("cannot dynamically allocate, sbrk now has control")});var t=z;return 0!=e&&nc.hb(e),t}function U(){return B[U.m>>2]}function oc(){return!!oc.ta}function pc(e){var t=p;try{e==__ZTIi&&(t=l)}catch(e){}try{e==__ZTIj&&(t=l)}catch(e){}try{e==__ZTIl&&(t=l)}catch(e){}try{e==__ZTIm&&(t=l)}catch(e){}try{e==__ZTIx&&(t=l)}catch(e){}try{e==__ZTIy&&(t=l)}catch(e){}try{e==__ZTIf&&(t=l)}catch(e){}try{e==__ZTId&&(t=l)}catch(e){}try{e==__ZTIe&&(t=l)}catch(e){}try{e==__ZTIc&&(t=l)}catch(e){}try{e==__ZTIa&&(t=l)}catch(e){}try{e==__ZTIh&&(t=l)}catch(e){}try{e==__ZTIs&&(t=l)}catch(e){}try{e==__ZTIt&&(t=l)}catch(e){}return t}function qc(e,t,r){if(0==r)return p;if(0==t||t==e)return l;switch(pc(t)?t:B[B[t>>2]-8>>2]){case 0:return 0==B[B[e>>2]-8>>2]?qc(B[e+8>>2],B[t+8>>2],r):p;case 1:return p;case 2:return qc(e,B[t+8>>2],r);default:return p}}function rc(e,t,r){if(!rc.sb){try{B[__ZTVN10__cxxabiv119__pointer_type_infoE>>2]=0}catch(e){}try{B[pb>>2]=1}catch(e){}try{B[ob>>2]=2}catch(e){}rc.sb=l}B[U.m>>2]=e,B[U.m+4>>2]=t,B[U.m+8>>2]=r,"uncaught_exception"in oc?oc.ta++:oc.ta=1,g(e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.")}function sc(e){try{return tc(e)}catch(e){}}function uc(){if(uc.Bb)uc.Bb=p;else{V.setThrew(0),B[U.m+4>>2]=0;var e=B[U.m>>2],t=B[U.m+8>>2];t&&(na("vi",t,[e]),B[U.m+8>>2]=0),e&&(sc(e),B[U.m>>2]=0)}}function wc(e){var t,r;wc.ia?(r=B[vc>>2],t=B[r>>2]):(wc.ia=l,W.USER="root",W.PATH="/",W.PWD="/",W.HOME="/home/emscripten",W.LANG="en_US.UTF-8",W._="./this.program",t=F(1024,"i8",E),r=F(256,"i8*",E),B[r>>2]=t,B[vc>>2]=r);var n,i=[],a=0;for(n in e)if("string"==typeof e[n]){var o=n+"="+e[n];i.push(o),a+=o.length}for(1024>2]=t,t+=o.length+1}B[r+4*i.length>>2]=0}function xc(e){return 0===e?0:(e=Fa(e),W.hasOwnProperty(e)?(xc.J&&tc(xc.J),xc.J=F(J(W[e]),"i8",Ka),xc.J):0)}function yc(e,t,r){if(e in ub){if(ub[e].length>r-1)return M(N.ab);for(e=ub[e],r=0;r>2],B[SDL.screen+0*ma>>2]=8388608|e),Kc()}function Mc(){var e=s.canvas;e.width=this.Ib,e.height=this.Hb,"undefined"!=typeof SDL&&(e=Qa[SDL.screen+0*ma>>2],B[SDL.screen+0*ma>>2]=-8388609&e),Kc()}function X(e,t){e!=m&&("number"==typeof e?this.p(e):t==m&&"string"!=typeof e?this.k(e,256):this.k(e,t))}function Yc(){return new X(m)}function Zc(e,t){var r=$c[e.charCodeAt(t)];return r==m?-1:r}function ad(e){var t=Yc();return t.D(e),t}function Y(e,t){this.h=0|e,this.j=0|t}function lb(e){function t(){if(ab||(ab=l,Va(Xa)),Va(Ya),gb=l,s._main&&kb&&s.callMain(e),s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)cb(s.postRun.shift());Va($a)}if(e=e||s.arguments,0>1];case"i32":case"i64":return B[e>>2];case"float":return Ia[e>>2];case"double":return Ja[e>>3];default:wa("invalid type for setValue: "+t)}return m};var Ka=0,La=1,E=2,Na=4;s.ALLOC_NORMAL=Ka,s.ALLOC_STACK=La,s.ALLOC_STATIC=E,s.ALLOC_DYNAMIC=3,s.ALLOC_NONE=Na,s.allocate=F,s.Pointer_stringify=Fa;var A,G,Ha,Pa,B,Qa,Ia,Ja,Ra=0,sa=0,Sa=0,u=0,Ta=0,Ua=0,z=0,va=s.TOTAL_MEMORY||33554432;w(!!(Int32Array&&Float64Array&&new Int32Array(1).subarray&&new Int32Array(1).set),"Cannot fallback to non-typed array case: Code is too specialized");var I=new ArrayBuffer(va);A=new Int8Array(I),Ha=new Int16Array(I),B=new Int32Array(I),G=new Uint8Array(I),Pa=new Uint16Array(I),Qa=new Uint32Array(I),Ia=new Float32Array(I),Ja=new Float64Array(I),B[0]=255,w(255===G[0]&&0===G[3],"Typed arrays 2 must be run on a little-endian system"),s.HEAP=k,s.HEAP8=A,s.HEAP16=Ha,s.HEAP32=B,s.HEAPU8=G,s.HEAPU16=Pa,s.HEAPU32=Qa,s.HEAPF32=Ia,s.HEAPF64=Ja;var Wa=[],Xa=[],Ya=[],Za=[],$a=[],ab=p;s.addOnPreRun=s.Vd=bb,s.addOnInit=s.Sd=function(e){Xa.unshift(e)},s.addOnPreMain=s.Ud=function(e){Ya.unshift(e)},s.addOnExit=s.Rd=function(e){Za.unshift(e)},s.addOnPostRun=s.Td=cb,s.intArrayFromString=J,s.intArrayToString=function(e){for(var t=[],r=0;r>>16)*n+r*(t>>>16)<<16)|0}),Math.ie=Math.imul;var L=0,fb={},gb=p,hb=m;s.addRunDependency=ib,s.removeRunDependency=jb,s.preloadedImages={},s.preloadedAudios={},Ra=8,sa=Ra+1312,Xa.push({V:function(){mb()}});var nb,ob,pb;nb=nb=F([0,0,0,0,0,0,0,0],"i8",E),ob=ob=F([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",E),pb=pb=F([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",E),F([111,112,116,105,111,110,32,114,101,113,117,105,114,101,115,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,115,0,0,0,0,0,0,0,111,112,116,105,111,110,32,114,101,113,117,105,114,101,115,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,99,0,0,0,0,0,0,0,0,0,0,0,0,0,36,64,0,0,0,0,0,0,89,64,0,0,0,0,0,136,195,64,0,0,0,0,132,215,151,65,0,128,224,55,121,195,65,67,23,110,5,181,181,184,147,70,245,249,63,233,3,79,56,77,50,29,48,249,72,119,130,90,60,191,115,127,221,79,21,117,56,3,0,0,0,0,0,0,63,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255,0,0,0,0,111,112,116,105,111,110,32,100,111,101,115,110,39,116,32,116,97,107,101,32,97,110,32,97,114,103,117,109,101,110,116,32,45,45,32,37,46,42,115,0,117,110,107,110,111,119,110,32,111,112,116,105,111,110,32,45,45,32,37,115,0,0,0,0,117,110,107,110,111,119,110,32,111,112,116,105,111,110,32,45,45,32,37,99,0,0,0,0,255,255,255,255,0,0,0,0,97,109,98,105,103,117,111,117,115,32,111,112,116,105,111,110,32,45,45,32,37,46,42,115,0,0,0,0,0,0,0,0,37,115,58,32,0,0,0,0,80,79,83,73,88,76,89,95,67,79,82,82,69,67,84,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,0,37,115,58,32,0,0,0,0,37,115,10,0,0,0,0,0,37,115,10,0,0,0,0,0,105,110,32,117,115,101,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,37,115,58,32,0,0,0,0,37,115,58,32,0,0,0,0,98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0,0,0,0,58,32,0,0,0,0,0,0,58,32,0,0,0,0,0,0,115,121,115,116,101,109,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,109,97,120,32,115,121,115,116,101,109,32,98,121,116,101,115,32,61,32,37,49,48,108,117,10,0,0,0,0,0,0,0,0,0,0,0,176,2,0,0,6,0,0,0,10,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,2,0,0,6,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,116,57,101,120,99,101,112,116,105,111,110,0,0,0,0,83,116,57,98,97,100,95,97,108,108,111,99,0,0,0,0,83,116,50,48,98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0,0,0,0,0,0,0,0,0,0,0,0,104,2,0,0,0,0,0,0,120,2,0,0,168,2,0,0,0,0,0,0,0,0,0,0,136,2,0,0,176,2,0,0,0,0,0,0,128,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,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],"i8",Na,8);var qb=xa(F(12,"i8",E),8);w(0==qb%8);var rb=0;s._memcpy=sb,s._memset=tb;var N={L:1,ca:2,Bd:3,sc:4,I:5,za:6,Jb:7,Sc:8,$:9,Zb:10,ua:11,Ld:11,$a:12,Ya:13,kc:14,ed:15,Wb:16,va:17,Md:18,wa:19,gd:20,aa:21,A:22,Mc:23,Za:24,ld:25,Id:26,lc:27,ad:28,da:29,yd:30,Fc:31,rd:32,hc:33,ab:34,Wc:35,pc:36,$b:37,vc:38,wc:39,xc:40,Ec:41,Jd:42,Qc:43,uc:44,ec:45,Tc:46,Pb:50,Sb:51,Nd:52,Oc:53,Tb:54,Ub:55,fc:56,Vb:57,cd:60,Rc:61,Fd:62,bd:63,Xc:64,Yc:65,xd:66,Uc:67,Mb:68,Cd:69,ac:70,td:71,Hc:74,yc:75,ic:76,Rb:77,mc:79,md:80,Qb:81,wd:82,zc:83,Ac:84,Dc:85,Cc:86,Bc:87,dd:88,Nc:89,ya:90,Ic:91,ba:92,nd:95,qd:96,dc:104,Pc:105,Nb:106,vd:107,jd:108,Zc:109,zd:110,cc:111,Kb:112,bc:113,Lc:114,Jc:115,Gd:116,nc:117,oc:118,rc:119,Ob:120,gc:121,Gc:122,ud:123,Ad:124,Lb:125,Kc:126,tc:127,fd:128,Hd:129,sd:130,Kd:131,jc:132,Dd:133,kd:134,Vc:135,$c:136,Yb:137,qc:138,od:139,Xb:140,hd:141,pd:142,Ed:143},ub={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"No message of desired type",36:"Identifier removed",37:"Channel number out of range",38:"Level 2 not synchronized",39:"Level 3 halted",40:"Level 3 reset",41:"Link number out of range",42:"Protocol driver not attached",43:"No CSI structure available",44:"Level 2 halted",45:"Deadlock condition",46:"No record locks available",50:"Invalid exchange",51:"Invalid request descriptor",52:"Exchange full",53:"No anode",54:"Invalid request code",55:"Invalid slot",56:"File locking deadlock error",57:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",74:"Multihop attempted",75:"Inode is remote (not really error)",76:"Cross mount point (not really error)",77:"Trying to read unreadable message",79:"Inappropriate file type or format",80:"Given log. name not unique",81:"f.d. invalid for this operation",82:"Remote address changed",83:"Can\t access a needed shared lib",84:"Accessing a corrupted shared lib",85:".lib section in a.out corrupted",86:"Attempting to link in too many libs",87:"Attempting to exec a shared library",88:"Function not implemented",89:"No more files",90:"Directory not empty",91:"File or path name too long",92:"Too many symbolic links",95:"Operation not supported on transport endpoint",96:"Protocol family not supported",104:"Connection reset by peer",105:"No buffer space available",106:"Address family not supported by protocol family",107:"Protocol wrong type for socket",108:"Socket operation on non-socket",109:"Protocol not available",110:"Can't send after socket shutdown",111:"Connection refused",112:"Address already in use",113:"Connection aborted",114:"Network is unreachable",115:"Network interface is not configured",116:"Connection timed out",117:"Host is down",118:"Host is unreachable",119:"Connection already in progress",120:"Socket already connected",121:"Destination address required",122:"Message too long",123:"Unknown protocol",124:"Socket type not supported",125:"Address not available",126:"ENETRESET",127:"Socket is already connected",128:"Socket is not connected",129:"TOOMANYREFS",130:"EPROCLIM",131:"EUSERS",132:"EDQUOT",133:"ESTALE",134:"Not supported",135:"No medium (in tape drive)",136:"No such host or network path",137:"Filename exists with different case",138:"EILSEQ",139:"Value too large for defined data type",140:"Operation canceled",141:"State not recoverable",142:"Previous owner died",143:"Streams pipe error"},Lb=[],Ob={open:function(e){Pb||(Pb=new pa);var t=Lb[e.d.X];t||g(new Q(N.wa)),e.q=t,e.seekable=p},close:function(e){e.q.H.length&&e.q.O.W(e.q,10)},Q:function(e,t,r,n){(!e.q||!e.q.O.Na)&&g(new Q(N.za));for(var i=0,a=0;ar.length;)r.push(0)}},tb:function(){g(new Q(N.ca))},Ta:function(e,t,r,n){return T.ka(e,t,r,n)},rename:function(e,t,r){if(16384==(61440&e.mode)){var n;try{n=Sb(t,r)}catch(e){}if(n)for(var i in n.g)g(new Q(N.ya))}delete e.parent.g[e.name],e.name=r,t.g[r]=e},ze:function(e,t){delete e.g[t]},ve:function(e,t){var r,n=Sb(e,t);for(r in n.g)g(new Q(N.ya));delete e.g[t]},Wa:function(e,t,r){return e=T.ka(e,t,41471,0),e.link=r,e},Va:function(e){return 40960!=(61440&e.mode)&&g(new Q(N.A)),e.link}},e:{open:function(e){if(16384==(61440&e.d.mode)){var t,r=[".",".."];for(t in e.d.g)e.d.g.hasOwnProperty(t)&&r.push(t);e.lb=r}},Q:function(e,t,r,n,i){if(e=e.d.g,n=Math.min(e.length-i,n),e.subarray)t.set(e.subarray(i,i+n),r);else for(var a=0;at&&g(new Q(N.A)),e.Gb=[],e.position=t},ue:function(e){return e.lb},Wd:function(e,t,r){for(e=e.d.g,t+=r;t>e.length;)e.push(0)},ne:function(e,t,r,n,i,a,o){return 32768!=(61440&e.d.mode)&&g(new Q(N.wa)),e=e.d.g,2&o?((0>2]=0;var Vb=Qb(m,"/",16895,0),Rc=T,Sc={type:Rc,se:{},Ua:"/",root:m},Tc;Tc=O("/",{N:p});var Uc=Rc.z(Sc);Uc.z=Sc,Sc.root=Uc,Tc&&(Tc.d.z=Sc,Tc.d.ub=l,Vb=Sc.root),zb("/tmp",511),zb("/dev",511),Nb[259]={e:{Q:function(){return 0},write:function(){return 0}}},Ab("/dev/null",438,259),Mb(1280,{Na:function(e){if(!e.input.length){var t=m;if(ca){if(process.Eb.be)return;t=process.Eb.Q()}else"undefined"!=typeof window&&"function"==typeof window.prompt?(t=window.prompt("Input: "))!==m&&(t+="\n"):"function"==typeof readline&&(t=readline())!==m&&(t+="\n");if(!t)return m;e.input=J(t,l)}return e.input.shift()},W:function(e,t){t===m||10===t?(s.print(e.H.join("")),e.H=[]):e.H.push(Pb.oa(t))}}),Mb(1536,{W:function(e,t){t===m||10===t?(s.printErr(e.H.join("")),e.H=[]):e.H.push(Pb.oa(t))}}),Ab("/dev/tty",438,1280),Ab("/dev/tty1",438,1536),zb("/dev/shm",511),zb("/dev/shm/tmp",511),Xa.unshift({V:function(){if(!s.noFSInit&&!bc){w(!bc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),bc=l,s.stdin=s.stdin,s.stdout=s.stdout,s.stderr=s.stderr,s.stdin?ec("/dev","stdin",s.stdin):Bb("/dev/tty","/dev/stdin"),s.stdout?ec("/dev","stdout",m,s.stdout):Bb("/dev/tty","/dev/stdout"),s.stderr?ec("/dev","stderr",m,s.stderr):Bb("/dev/tty1","/dev/stderr");var e=Db("/dev/stdin","r");B[Tb>>2]=e.s,w(1===e.s,"invalid handle for stdin ("+e.s+")"),e=Db("/dev/stdout","w"),B[Ub>>2]=e.s,w(2===e.s,"invalid handle for stdout ("+e.s+")"),e=Db("/dev/stderr","w"),B[nb>>2]=e.s,w(3===e.s,"invalid handle for stderr ("+e.s+")")}}}),Ya.push({V:function(){Yb=p}}),Za.push({V:function(){bc=p;for(var e=0;e>a-6&63,a=a-6,r=r+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f];2==a?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&n)<<4],r+="=="):4==a&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&n)<<2],r+="="),u.src="data:audio/x-"+t.substr(-3)+";base64,"+r,i(u)}},u.src=f,setTimeout(function(){za||i(u)},1e4)}});var h=s.canvas;h.qa=h.requestPointerLock||h.mozRequestPointerLock||h.webkitRequestPointerLock,h.La=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||aa(),h.La=h.La.bind(document),document.addEventListener("pointerlockchange",u,p),document.addEventListener("mozpointerlockchange",u,p),document.addEventListener("webkitpointerlockchange",u,p),s.elementPointerLock&&h.addEventListener("click",function(e){!Ec&&h.qa&&(h.qa(),e.preventDefault())},p)}var d,b=S.apply(m,[e,t]);if("/"==b[0]&&(b=b.substr(1)),d=b,ib("cp "+d),"string"==typeof r){var v=o,y=function(){v?v():g('Loading data file "'+r+'" failed.')},_=new XMLHttpRequest;_.open("GET",r,l),_.responseType="arraybuffer",_.onload=function(){if(200==_.status||0==_.status&&_.response){var e=_.response;w(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),e=new Uint8Array(e),c(e),jb("al "+r)}else y()},_.onerror=y,_.send(m),ib("al "+r)}else c(r)},s.FS_createLazyFile=function(e,t,r,n,i){var a,o;"undefined"!=typeof XMLHttpRequest?(ea||g("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"),a=function(){this.ma=p,this.T=[]},a.prototype.get=function(e){if(!(e>this.length-1||0>e)){var t=e%this.S;return this.pb(Math.floor(e/this.S))[t]}},a.prototype.Cb=function(e){this.pb=e},a.prototype.Fa=function(){var e=new XMLHttpRequest;e.open("HEAD",r,p),e.send(m),200<=e.status&&300>e.status||304===e.status||g(Error("Couldn't load "+r+". Status: "+e.status));var t,n=Number(e.getResponseHeader("Content-length")),i=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(i=n);var a=this;a.Cb(function(e){var t=e*i,o=(e+1)*i-1,o=Math.min(o,n-1);if(void 0===a.T[e]){var s=a.T;t>o&&g(Error("invalid range ("+t+", "+o+") or no bytes requested!")),o>n-1&&g(Error("only "+n+" bytes available! programmer error!"));var f=new XMLHttpRequest;f.open("GET",r,p),n!==i&&f.setRequestHeader("Range","bytes="+t+"-"+o),"undefined"!=typeof Uint8Array&&(f.responseType="arraybuffer"),f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined"),f.send(m),200<=f.status&&300>f.status||304===f.status||g(Error("Couldn't load "+r+". Status: "+f.status)),t=f.response!==k?new Uint8Array(f.response||[]):J(f.responseText||"",l),s[e]=t}return void 0===a.T[e]&&g(Error("doXHR failed!")),a.T[e]}),this.gb=n,this.fb=i,this.ma=l},a=new a,Object.defineProperty(a,"length",{get:function(){return this.ma||this.Fa(),this.gb}}),Object.defineProperty(a,"chunkSize",{get:function(){return this.ma||this.Fa(),this.fb}}),o=k):(o=r,a=k);var f,e=S("string"==typeof e?e:ac(e),t);f=yb(e,cc(n,i)),a?f.g=a:o&&(f.g=m,f.url=o);var u={};return Object.keys(f.e).forEach(function(e){var t=f.e[e];u[e]=function(){var e;if(f.ke||f.le||f.link||f.g)e=l;else{if(e=l,"undefined"!=typeof XMLHttpRequest&&g(Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")),s.read)try{f.g=J(s.read(f.url),l)}catch(t){e=p}else g(Error("Cannot load without read() or XMLHttpRequest."));e||M(N.I)}return e||g(new Q(N.I)),t.apply(m,arguments)}}),u.Q=function(e,t,r,n,i){if(e=e.d.g,n=Math.min(e.length-i,n),e.slice)for(var a=0;a>3<<3;return t|0}function at(){return h|0}function ot(e){e=e|0;h=e}function st(e,t){e=e|0;t=t|0;if((k|0)==0){k=e;x=t}}function ft(e){e=e|0;n[d]=n[e];n[d+1|0]=n[e+1|0];n[d+2|0]=n[e+2|0];n[d+3|0]=n[e+3|0]}function ut(e){e=e|0;n[d]=n[e];n[d+1|0]=n[e+1|0];n[d+2|0]=n[e+2|0];n[d+3|0]=n[e+3|0];n[d+4|0]=n[e+4|0];n[d+5|0]=n[e+5|0];n[d+6|0]=n[e+6|0];n[d+7|0]=n[e+7|0]}function ct(e){e=e|0;j=e}function ht(e){e=e|0;z=e}function lt(e){e=e|0;L=e}function dt(e){e=e|0;H=e}function pt(e){e=e|0;F=e}function bt(e){e=e|0;U=e}function vt(e){e=e|0;D=e}function mt(e){e=e|0;q=e}function gt(e){e=e|0;K=e}function yt(e){e=e|0;Y=e}function wt(){a[170]=y+8;a[172]=g+8;a[176]=g+8}function _t(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)==0){return}else{i=0}do{n[e+i|0]=n[t+i|0]|0;i=i+1|0}while(i>>>0>>0);return}function St(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,a=0;if((r|0)==0){return}else{i=0}do{a=e+i|0;n[a]=n[a]^n[t+i|0];i=i+1|0}while(i>>>0>>0);return}function kt(e){e=e|0;var t=0,r=0,n=0,i=0;t=o[e+1|0]|0;r=o[e+2|0]|0;n=o[e+3|0]|0;i=rn(t<<8|0>>>24|(o[e]|0)|(r<<16|0>>>16)|(n<<24|0>>>8)|(0<<8|0>>>24),0<<8|t>>>24|(0<<16|r>>>16)|(0<<24|n>>>8)|(o[e+4|0]|0)|((o[e+5|0]|0)<<8|0>>>24),0<<16|0>>>16,(o[e+6|0]|0)<<16|0>>>16)|0;n=rn(i,j,0<<24|0>>>8,(o[e+7|0]|0)<<24|0>>>8)|0;return(j=j,n)|0}function xt(e){e=e|0;return(o[e+1|0]|0)<<8|(o[e]|0)|(o[e+2|0]|0)<<16|(o[e+3|0]|0)<<24|0}function At(e,t){e=e|0;t=t|0;n[e]=t&255;n[e+1|0]=t>>>8&255;n[e+2|0]=t>>>16&255;n[e+3|0]=t>>>24&255;return}function Mt(e){e=e|0;a[e+36>>2]=0;a[e+32>>2]=0;a[e>>2]=1779033703;a[e+4>>2]=-1150833019;a[e+8>>2]=1013904242;a[e+12>>2]=-1521486534;a[e+16>>2]=1359893119;a[e+20>>2]=-1694144372;a[e+24>>2]=528734635;a[e+28>>2]=1541459225;return}function Et(e,t,r,n,i,o,s,f,u,c){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;o=o|0;s=s|0;f=f|0;u=u|0;c=c|0;var h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0;h=dn(f,0,s,0)|0;l=j;d=0;if(l>>>0>d>>>0|l>>>0==d>>>0&h>>>0>1073741823>>>0){a[($e()|0)>>2]=27;p=-1;return p|0}h=rn(i,o,-1,-1)|0;if((h&i|0)!=0|(j&o|0)!=0|(i|0)==0&(o|0)==0){a[($e()|0)>>2]=22;p=-1;return p|0}do{if(!((33554431/(f>>>0)|0)>>>0>>0|s>>>0>16777215)){h=0;if(h>>>0>>0|h>>>0==o>>>0&(33554431/(s>>>0)|0)>>>0>>0){break}h=s<<7;d=Kt(oe(h,f)|0)|0;if((d|0)==0){p=-1;return p|0}l=Kt(s<<8)|0;do{if((l|0)!=0){b=dn(h,0,i,o)|0;v=Kt(b)|0;if((v|0)==0){Yt(l);break}b=oe(f<<7,s)|0;Dt(e,t,r,n,1,0,d,b);if((f|0)!=0){m=s<<7;g=0;do{It(d+(oe(m,g)|0)|0,s,i,o,v,l);g=g+1|0}while(g>>>0>>0)}Dt(e,t,d,b,1,0,u,c);Yt(v);Yt(l);Yt(d);p=0;return p|0}}while(0);Yt(d);p=-1;return p|0}}while(0);a[($e()|0)>>2]=12;p=-1;return p|0}function It(e,t,r,n,i,a){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;a=a|0;var o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0;o=t<<7;s=a+o|0;_t(a,e,o);if((r|0)==0&(n|0)==0){_t(e,a,o);return}f=o;u=0;c=0;h=0;do{l=dn(h,c,f,u)|0;_t(i+l|0,a,o);Tt(a,s,t);h=rn(h,c,1,0)|0;c=j}while(c>>>0>>0|c>>>0==n>>>0&h>>>0>>0);if((r|0)==0&(n|0)==0){_t(e,a,o);return}h=rn(r,n,-1,-1)|0;c=j;u=o;f=0;l=0;d=0;do{p=Rt(a,t)|0;b=dn(p&h,j&c,u,f)|0;St(a,i+b|0,o);Tt(a,s,t);d=rn(d,l,1,0)|0;l=j}while(l>>>0>>0|l>>>0==n>>>0&d>>>0>>0);_t(e,a,o);return}function Tt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,a=0,o=0,s=0,f=0,u=0;n=h;h=h+64|0;i=n|0;a=r<<1;_t(i,e+((r<<7)-64)|0,64);if((a|0)!=0){o=0;do{s=o<<6;St(i,e+s|0,64);Pt(i);_t(t+s|0,i,64);o=o+1|0}while(o>>>0>>0)}if((r|0)==0){h=n;return}else{f=0}do{_t(e+(f<<6)|0,t+(f<<7)|0,64);f=f+1|0}while(f>>>0>>0);if((r|0)==0){h=n;return}else{u=0}do{_t(e+(u+r<<6)|0,t+(u<<7|64)|0,64);u=u+1|0}while(u>>>0>>0);h=n;return}function Rt(e,t){e=e|0;t=t|0;var r=0;r=kt(e+((t<<7)-64)|0)|0;return(j=j,r)|0}function Pt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,H=0,F=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0;t=h;h=h+128|0;r=t|0;n=t+64|0;i=0;do{a[r+(i<<2)>>2]=xt(e+(i<<2)|0)|0;i=i+1|0}while(i>>>0<16);i=r;o=n;Jr(o|0,i|0,64)|0;i=n|0;o=n+48|0;s=n+16|0;f=n+32|0;u=n+20|0;c=n+4|0;l=n+36|0;d=n+52|0;p=n+40|0;b=n+24|0;v=n+56|0;m=n+8|0;g=n+60|0;y=n+44|0;w=n+12|0;_=n+28|0;S=0;k=a[i>>2]|0;x=a[o>>2]|0;A=a[s>>2]|0;M=a[f>>2]|0;E=a[u>>2]|0;I=a[c>>2]|0;T=a[l>>2]|0;R=a[d>>2]|0;P=a[p>>2]|0;B=a[b>>2]|0;C=a[v>>2]|0;O=a[m>>2]|0;N=a[g>>2]|0;j=a[y>>2]|0;z=a[w>>2]|0;L=a[_>>2]|0;do{H=x+k|0;F=(H<<7|H>>>25)^A;H=F+k|0;U=(H<<9|H>>>23)^M;H=U+F|0;D=(H<<13|H>>>19)^x;H=D+U|0;q=(H<<18|H>>>14)^k;H=I+E|0;K=(H<<7|H>>>25)^T;H=K+E|0;Y=(H<<9|H>>>23)^R;H=Y+K|0;V=(H<<13|H>>>19)^I;H=V+Y|0;W=(H<<18|H>>>14)^E;H=B+P|0;X=(H<<7|H>>>25)^C;H=X+P|0;Z=(H<<9|H>>>23)^O;H=Z+X|0;G=(H<<13|H>>>19)^B;H=G+Z|0;Q=(H<<18|H>>>14)^P;H=j+N|0;$=(H<<7|H>>>25)^z;H=$+N|0;J=(H<<9|H>>>23)^L;H=J+$|0;ee=(H<<13|H>>>19)^j;H=ee+J|0;te=(H<<18|H>>>14)^N;H=$+q|0;I=(H<<7|H>>>25)^V;V=I+q|0;O=(V<<9|V>>>23)^Z;Z=O+I|0;z=(Z<<13|Z>>>19)^$;$=z+O|0;k=($<<18|$>>>14)^q;q=F+W|0;B=(q<<7|q>>>25)^G;G=B+W|0;L=(G<<9|G>>>23)^J;J=L+B|0;A=(J<<13|J>>>19)^F;F=A+L|0;E=(F<<18|F>>>14)^W;W=K+Q|0;j=(W<<7|W>>>25)^ee;ee=j+Q|0;M=(ee<<9|ee>>>23)^U;U=M+j|0;T=(U<<13|U>>>19)^K;K=T+M|0;P=(K<<18|K>>>14)^Q;Q=X+te|0;x=(Q<<7|Q>>>25)^D;D=x+te|0;R=(D<<9|D>>>23)^Y;Y=R+x|0;C=(Y<<13|Y>>>19)^X;X=C+R|0;N=(X<<18|X>>>14)^te;S=S+2|0}while(S>>>0<8);a[i>>2]=k;a[o>>2]=x;a[s>>2]=A;a[f>>2]=M;a[u>>2]=E;a[c>>2]=I;a[l>>2]=T;a[d>>2]=R;a[p>>2]=P;a[b>>2]=B;a[v>>2]=C;a[m>>2]=O;a[g>>2]=N;a[y>>2]=j;a[w>>2]=z;a[_>>2]=L;L=r|0;a[L>>2]=(a[L>>2]|0)+(a[n>>2]|0);L=r+4|0;a[L>>2]=(a[L>>2]|0)+(a[n+4>>2]|0);L=r+8|0;a[L>>2]=(a[L>>2]|0)+(a[n+8>>2]|0);L=r+12|0;a[L>>2]=(a[L>>2]|0)+(a[n+12>>2]|0);L=r+16|0;a[L>>2]=(a[L>>2]|0)+(a[n+16>>2]|0);L=r+20|0;a[L>>2]=(a[L>>2]|0)+(a[n+20>>2]|0);L=r+24|0;a[L>>2]=(a[L>>2]|0)+(a[n+24>>2]|0);L=r+28|0;a[L>>2]=(a[L>>2]|0)+(a[n+28>>2]|0);L=r+32|0;a[L>>2]=(a[L>>2]|0)+(a[n+32>>2]|0);L=r+36|0;a[L>>2]=(a[L>>2]|0)+(a[n+36>>2]|0);L=r+40|0;a[L>>2]=(a[L>>2]|0)+(a[n+40>>2]|0);L=r+44|0;a[L>>2]=(a[L>>2]|0)+(a[n+44>>2]|0);L=r+48|0;a[L>>2]=(a[L>>2]|0)+(a[n+48>>2]|0);L=r+52|0;a[L>>2]=(a[L>>2]|0)+(a[n+52>>2]|0);L=r+56|0;a[L>>2]=(a[L>>2]|0)+(a[n+56>>2]|0);L=r+60|0;a[L>>2]=(a[L>>2]|0)+(a[n+60>>2]|0);n=0;do{At(e+(n<<2)|0,a[r+(n<<2)>>2]|0);n=n+1|0}while(n>>>0<16);h=t;return}function Bt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,o=0,s=0,f=0,u=0,c=0;n=e+32|0;i=e+36|0;o=a[i>>2]|0;s=o>>>3&63;f=De(o|0,r<<3|0)|0;a[i>>2]=f;if(j){f=n|0;a[f>>2]=(a[f>>2]|0)+1}f=n|0;a[f>>2]=(a[f>>2]|0)+(r>>>29);f=64-s|0;n=e+40+s|0;if(f>>>0>r>>>0){Jr(n|0,t|0,r)|0;return}Jr(n|0,t|0,f)|0;n=e|0;s=e+40|0;Ct(n,s);e=t+f|0;t=r-f|0;if(t>>>0>63){f=t;r=e;while(1){Ct(n,r);i=r+64|0;o=f-64|0;if(o>>>0>63){f=o;r=i}else{u=o;c=i;break}}}else{u=t;c=e}Jr(s|0,c|0,u)|0;return}function Ct(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0;r=h;h=h+288|0;n=r|0;i=r+256|0;o=n|0;qt(o,t);t=16;do{s=a[n+(t-2<<2)>>2]|0;f=a[n+(t-15<<2)>>2]|0;a[n+(t<<2)>>2]=(a[n+(t-16<<2)>>2]|0)+(a[n+(t-7<<2)>>2]|0)+((s>>>19|s<<13)^s>>>10^(s>>>17|s<<15))+((f>>>18|f<<14)^f>>>3^(f>>>7|f<<25));t=t+1|0}while((t|0)<64);t=i;f=e;Jr(t|0,f|0,32)|0;f=i+28|0;t=i+16|0;s=a[t>>2]|0;u=i+20|0;c=i+24|0;l=a[c>>2]|0;d=(a[f>>2]|0)+1116352408+(a[o>>2]|0)+((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((l^a[u>>2])&s^l)|0;l=i|0;s=a[l>>2]|0;o=i+4|0;p=a[o>>2]|0;b=i+8|0;v=a[b>>2]|0;m=i+12|0;a[m>>2]=(a[m>>2]|0)+d;g=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+d+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)+1899447441+(a[n+4>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)-1245643825+(a[n+8>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)-373957723+(a[n+12>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)+961987163+(a[n+16>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)+1508970993+(a[n+20>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)-1841331548+(a[n+24>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)-1424204075+(a[n+28>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)-670586216+(a[n+32>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+310598401+(a[n+36>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)+607225278+(a[n+40>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)+1426881987+(a[n+44>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)+1925078388+(a[n+48>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)-2132889090+(a[n+52>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-1680079193+(a[n+56>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;p=a[u>>2]|0;v=a[f>>2]|0;d=(a[l>>2]|0)-1046744716+(a[n+60>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[l>>2]=g;v=a[t>>2]|0;p=a[c>>2]|0;s=(a[f>>2]|0)-459576895+(a[n+64>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[f>>2]=d;p=a[m>>2]|0;v=a[u>>2]|0;g=(a[c>>2]|0)-272742522+(a[n+68>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[c>>2]=s;v=a[b>>2]|0;p=a[t>>2]|0;d=(a[u>>2]|0)+264347078+(a[n+72>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[u>>2]=g;p=a[o>>2]|0;v=a[m>>2]|0;s=(a[t>>2]|0)+604807628+(a[n+76>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[t>>2]=d;v=a[l>>2]|0;p=a[b>>2]|0;g=(a[m>>2]|0)+770255983+(a[n+80>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[m>>2]=s;p=a[f>>2]|0;v=a[o>>2]|0;d=(a[b>>2]|0)+1249150122+(a[n+84>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[b>>2]=g;v=a[c>>2]|0;p=a[l>>2]|0;s=(a[o>>2]|0)+1555081692+(a[n+88>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[o>>2]=d;p=a[u>>2]|0;v=a[f>>2]|0;g=(a[l>>2]|0)+1996064986+(a[n+92>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[l>>2]=s;v=a[t>>2]|0;p=a[c>>2]|0;d=(a[f>>2]|0)-1740746414+(a[n+96>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)-1473132947+(a[n+100>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)-1341970488+(a[n+104>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)-1084653625+(a[n+108>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)-958395405+(a[n+112>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)-710438585+(a[n+116>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)+113926993+(a[n+120>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)+338241895+(a[n+124>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)+666307205+(a[n+128>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+773529912+(a[n+132>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)+1294757372+(a[n+136>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)+1396182291+(a[n+140>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)+1695183700+(a[n+144>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)+1986661051+(a[n+148>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-2117940946+(a[n+152>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;p=a[u>>2]|0;v=a[f>>2]|0;d=(a[l>>2]|0)-1838011259+(a[n+156>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[l>>2]=g;v=a[t>>2]|0;p=a[c>>2]|0;s=(a[f>>2]|0)-1564481375+(a[n+160>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[f>>2]=d;p=a[m>>2]|0;v=a[u>>2]|0;g=(a[c>>2]|0)-1474664885+(a[n+164>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[c>>2]=s;v=a[b>>2]|0;p=a[t>>2]|0;d=(a[u>>2]|0)-1035236496+(a[n+168>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[u>>2]=g;p=a[o>>2]|0;v=a[m>>2]|0;s=(a[t>>2]|0)-949202525+(a[n+172>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[t>>2]=d;v=a[l>>2]|0;p=a[b>>2]|0;g=(a[m>>2]|0)-778901479+(a[n+176>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[m>>2]=s;p=a[f>>2]|0;v=a[o>>2]|0;d=(a[b>>2]|0)-694614492+(a[n+180>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[b>>2]=g;v=a[c>>2]|0;p=a[l>>2]|0;s=(a[o>>2]|0)-200395387+(a[n+184>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[o>>2]=d;p=a[u>>2]|0;v=a[f>>2]|0;g=(a[l>>2]|0)+275423344+(a[n+188>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[l>>2]=s;v=a[t>>2]|0;p=a[c>>2]|0;d=(a[f>>2]|0)+430227734+(a[n+192>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[f>>2]=g;p=a[m>>2]|0;v=a[u>>2]|0;s=(a[c>>2]|0)+506948616+(a[n+196>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[c>>2]=d;v=a[b>>2]|0;p=a[t>>2]|0;g=(a[u>>2]|0)+659060556+(a[n+200>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[u>>2]=s;p=a[o>>2]|0;v=a[m>>2]|0;d=(a[t>>2]|0)+883997877+(a[n+204>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[t>>2]=g;v=a[l>>2]|0;p=a[b>>2]|0;s=(a[m>>2]|0)+958139571+(a[n+208>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[m>>2]=d;p=a[f>>2]|0;v=a[o>>2]|0;g=(a[b>>2]|0)+1322822218+(a[n+212>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[b>>2]=s;v=a[c>>2]|0;p=a[l>>2]|0;d=(a[o>>2]|0)+1537002063+(a[n+216>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[o>>2]=g;p=a[u>>2]|0;v=a[f>>2]|0;s=(a[l>>2]|0)+1747873779+(a[n+220>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[c>>2])&p^v)|0;v=a[b>>2]|0;p=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[l>>2]=d;v=a[t>>2]|0;p=a[c>>2]|0;g=(a[f>>2]|0)+1955562222+(a[n+224>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[u>>2])&v^p)|0;p=a[o>>2]|0;v=a[b>>2]|0;a[m>>2]=(a[m>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[f>>2]=s;p=a[m>>2]|0;v=a[u>>2]|0;d=(a[c>>2]|0)+2024104815+(a[n+228>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[t>>2])&p^v)|0;v=a[l>>2]|0;p=a[o>>2]|0;a[b>>2]=(a[b>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((p|v)&s|p&v)|0;a[c>>2]=g;v=a[b>>2]|0;p=a[t>>2]|0;s=(a[u>>2]|0)-2067236844+(a[n+232>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[m>>2])&v^p)|0;p=a[f>>2]|0;v=a[l>>2]|0;a[o>>2]=(a[o>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((v|p)&g|v&p)|0;a[u>>2]=d;p=a[o>>2]|0;v=a[m>>2]|0;g=(a[t>>2]|0)-1933114872+(a[n+236>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[b>>2])&p^v)|0;v=a[c>>2]|0;p=a[f>>2]|0;a[l>>2]=(a[l>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((p|v)&d|p&v)|0;a[t>>2]=s;v=a[l>>2]|0;p=a[b>>2]|0;d=(a[m>>2]|0)-1866530822+(a[n+240>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[o>>2])&v^p)|0;p=a[u>>2]|0;v=a[c>>2]|0;a[f>>2]=(a[f>>2]|0)+d;g=d+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((v|p)&s|v&p)|0;a[m>>2]=g;p=a[f>>2]|0;v=a[o>>2]|0;s=(a[b>>2]|0)-1538233109+(a[n+244>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((v^a[l>>2])&p^v)|0;v=a[t>>2]|0;p=a[u>>2]|0;a[c>>2]=(a[c>>2]|0)+s;d=s+((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+((p|v)&g|p&v)|0;a[b>>2]=d;v=a[c>>2]|0;p=a[l>>2]|0;g=(a[o>>2]|0)-1090935817+(a[n+248>>2]|0)+((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+((p^a[f>>2])&v^p)|0;p=a[m>>2]|0;v=a[t>>2]|0;a[u>>2]=(a[u>>2]|0)+g;s=g+((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+((v|p)&d|v&p)|0;a[o>>2]=s;o=a[u>>2]|0;u=a[f>>2]|0;f=(a[l>>2]|0)-965641998+(a[n+252>>2]|0)+((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+((u^a[c>>2])&o^u)|0;u=a[b>>2]|0;b=a[m>>2]|0;a[t>>2]=(a[t>>2]|0)+f;t=f+((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+((b|u)&s|b&u)|0;a[l>>2]=t;a[e>>2]=(a[e>>2]|0)+t;t=e+4|0;a[t>>2]=(a[t>>2]|0)+(a[i+4>>2]|0);t=e+8|0;a[t>>2]=(a[t>>2]|0)+(a[i+8>>2]|0);t=e+12|0;a[t>>2]=(a[t>>2]|0)+(a[i+12>>2]|0);t=e+16|0;a[t>>2]=(a[t>>2]|0)+(a[i+16>>2]|0);t=e+20|0;a[t>>2]=(a[t>>2]|0)+(a[i+20>>2]|0);t=e+24|0;a[t>>2]=(a[t>>2]|0)+(a[i+24>>2]|0);t=e+28|0;a[t>>2]=(a[t>>2]|0)+(a[i+28>>2]|0);h=r;return}function Ot(e,t){e=e|0;t=t|0;n[e+3|0]=t&255;n[e+2|0]=t>>>8&255;n[e+1|0]=t>>>16&255;n[e]=t>>>24&255;return}function Nt(e){e=e|0;return(o[e+2|0]|0)<<8|(o[e+3|0]|0)|(o[e+1|0]|0)<<16|(o[e]|0)<<24|0}function jt(e,t){e=e|0;t=t|0;zt(t);Lt(e,t|0,32);en(t|0,0,104);return}function zt(e){e=e|0;var t=0,r=0,n=0;t=h;h=h+8|0;r=t|0;Lt(r,e+32|0,8);n=(a[e+36>>2]|0)>>>3&63;Bt(e,720,(n>>>0<56?56:120)-n|0);Bt(e,r,8);h=t;return}function Lt(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=r>>>2;if((n|0)==0){return}else{i=0}do{Ot(e+(i<<2)|0,a[t+(i<<2)>>2]|0);i=i+1|0}while(i>>>0>>0);return}function Ht(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,a=0,o=0,s=0,f=0,u=0,c=0;i=h;h=h+96|0;a=i|0;if(r>>>0>64){o=e|0;Mt(o);Bt(o,t,r);s=i+64|0;jt(s,o);f=s;u=32}else{f=t;u=r}r=e|0;Mt(r);t=a|0;en(t|0,54,64);if((u|0)!=0){s=0;do{o=a+s|0;n[o]=n[o]^n[f+s|0];s=s+1|0}while(s>>>0>>0)}Bt(r,t,64);r=e+104|0;Mt(r);en(t|0,92,64);if((u|0)==0){Bt(r,t,64);h=i;return}else{c=0}do{e=a+c|0;n[e]=n[e]^n[f+c|0];c=c+1|0}while(c>>>0>>0);Bt(r,t,64);h=i;return}function Ft(e,t,r){e=e|0;t=t|0;r=r|0;Bt(e|0,t,r);return}function Ut(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+32|0;n=r|0;jt(n,t|0);i=t+104|0;Bt(i,n,32);jt(e,i);h=r;return}function Dt(e,t,r,i,a,o,s,f){e=e|0;t=t|0;r=r|0;i=i|0;a=a|0;o=o|0;s=s|0;f=f|0;var u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0;u=h;h=h+488|0;c=u|0;l=u+208|0;d=u+424|0;p=u+456|0;Ht(c,e,t);Ft(c,r,i);if((f|0)==0){h=u;return}i=u+416|0;r=l;b=c;c=d|0;v=p|0;m=0;g=o>>>0>>0|o>>>0==m>>>0&a>>>0<2>>>0;m=0;y=0;do{m=m+1|0;Ot(i,m);Jr(r|0,b|0,208)|0;Ft(l,i,4);Ut(c,l);Jr(v|0,c|0,32)|0;if(!g){w=0;_=2;do{Ht(l,e,t);Ft(l,c,32);Ut(c,l);S=0;do{k=p+S|0;n[k]=n[k]^n[d+S|0];S=S+1|0}while((S|0)<32);_=rn(_,w,1,0)|0;w=j}while(!(w>>>0>o>>>0|w>>>0==o>>>0&_>>>0>a>>>0))}_=f-y|0;w=_>>>0>32?32:_;_=s+y|0;Jr(_|0,v|0,w)|0;y=m<<5}while(y>>>0>>0);h=u;return}function qt(e,t){e=e|0;t=t|0;var r=0;r=0;do{a[e+(r<<2)>>2]=Nt(t+(r<<2)|0)|0;r=r+1|0}while(r>>>0<16);return}function Kt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,H=0,F=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0,re=0,ne=0,ie=0,ae=0,oe=0,se=0,fe=0,ue=0,ce=0,he=0,le=0,de=0,pe=0,be=0,ve=0,me=0,ge=0,ye=0,_e=0,Se=0,xe=0,Ae=0,Me=0,Ee=0,Ie=0,Te=0,Re=0,Pe=0,Be=0,Ce=0,Oe=0;do{if(e>>>0<245){if(e>>>0<11){t=16}else{t=e+11&-8}r=t>>>3;n=a[208]|0;i=n>>>(r>>>0);if((i&3|0)!=0){o=(i&1^1)+r|0;s=o<<1;f=872+(s<<2)|0;u=872+(s+2<<2)|0;s=a[u>>2]|0;c=s+8|0;h=a[c>>2]|0;do{if((f|0)==(h|0)){a[208]=n&~(1<>>0<(a[212]|0)>>>0){ke();return 0}l=h+12|0;if((a[l>>2]|0)==(s|0)){a[l>>2]=f;a[u>>2]=h;break}else{ke();return 0}}}while(0);h=o<<3;a[s+4>>2]=h|3;u=s+(h|4)|0;a[u>>2]=a[u>>2]|1;d=c;return d|0}if(t>>>0<=(a[210]|0)>>>0){p=t;break}if((i|0)!=0){u=2<>>12&16;f=u>>>(h>>>0);u=f>>>5&8;l=f>>>(u>>>0);f=l>>>2&4;b=l>>>(f>>>0);l=b>>>1&2;v=b>>>(l>>>0);b=v>>>1&1;m=(u|h|f|l|b)+(v>>>(b>>>0))|0;b=m<<1;v=872+(b<<2)|0;l=872+(b+2<<2)|0;b=a[l>>2]|0;f=b+8|0;h=a[f>>2]|0;do{if((v|0)==(h|0)){a[208]=n&~(1<>>0<(a[212]|0)>>>0){ke();return 0}u=h+12|0;if((a[u>>2]|0)==(b|0)){a[u>>2]=v;a[l>>2]=h;break}else{ke();return 0}}}while(0);h=m<<3;l=h-t|0;a[b+4>>2]=t|3;v=b;n=v+t|0;a[v+(t|4)>>2]=l|1;a[v+h>>2]=l;h=a[210]|0;if((h|0)!=0){v=a[213]|0;r=h>>>3;h=r<<1;i=872+(h<<2)|0;c=a[208]|0;s=1<>2]|0;if(o>>>0>=(a[212]|0)>>>0){g=o;y=r;break}ke();return 0}}while(0);a[y>>2]=v;a[g+12>>2]=v;a[v+8>>2]=g;a[v+12>>2]=i}a[210]=l;a[213]=n;d=f;return d|0}h=a[209]|0;if((h|0)==0){p=t;break}s=(h&-h)-1|0;h=s>>>12&16;c=s>>>(h>>>0);s=c>>>5&8;b=c>>>(s>>>0);c=b>>>2&4;m=b>>>(c>>>0);b=m>>>1&2;r=m>>>(b>>>0);m=r>>>1&1;o=a[1136+((s|h|c|b|m)+(r>>>(m>>>0))<<2)>>2]|0;m=o;r=o;b=(a[o+4>>2]&-8)-t|0;while(1){o=a[m+16>>2]|0;if((o|0)==0){c=a[m+20>>2]|0;if((c|0)==0){break}else{w=c}}else{w=o}o=(a[w+4>>2]&-8)-t|0;c=o>>>0>>0;m=w;r=c?w:r;b=c?o:b}m=r;f=a[212]|0;if(m>>>0>>0){ke();return 0}n=m+t|0;l=n;if(m>>>0>=n>>>0){ke();return 0}n=a[r+24>>2]|0;i=a[r+12>>2]|0;do{if((i|0)==(r|0)){v=r+20|0;o=a[v>>2]|0;if((o|0)==0){c=r+16|0;h=a[c>>2]|0;if((h|0)==0){_=0;break}else{S=h;k=c}}else{S=o;k=v}while(1){v=S+20|0;o=a[v>>2]|0;if((o|0)!=0){S=o;k=v;continue}v=S+16|0;o=a[v>>2]|0;if((o|0)==0){break}else{S=o;k=v}}if(k>>>0>>0){ke();return 0}else{a[k>>2]=0;_=S;break}}else{v=a[r+8>>2]|0;if(v>>>0>>0){ke();return 0}o=v+12|0;if((a[o>>2]|0)!=(r|0)){ke();return 0}c=i+8|0;if((a[c>>2]|0)==(r|0)){a[o>>2]=i;a[c>>2]=v;_=i;break}else{ke();return 0}}}while(0);e:do{if((n|0)!=0){i=r+28|0;f=1136+(a[i>>2]<<2)|0;do{if((r|0)==(a[f>>2]|0)){a[f>>2]=_;if((_|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(n>>>0<(a[212]|0)>>>0){ke();return 0}v=n+16|0;if((a[v>>2]|0)==(r|0)){a[v>>2]=_}else{a[n+20>>2]=_}if((_|0)==0){break e}}}while(0);if(_>>>0<(a[212]|0)>>>0){ke();return 0}a[_+24>>2]=n;i=a[r+16>>2]|0;do{if((i|0)!=0){if(i>>>0<(a[212]|0)>>>0){ke();return 0}else{a[_+16>>2]=i;a[i+24>>2]=_;break}}}while(0);i=a[r+20>>2]|0;if((i|0)==0){break}if(i>>>0<(a[212]|0)>>>0){ke();return 0}else{a[_+20>>2]=i;a[i+24>>2]=_;break}}}while(0);if(b>>>0<16){n=b+t|0;a[r+4>>2]=n|3;i=m+(n+4)|0;a[i>>2]=a[i>>2]|1}else{a[r+4>>2]=t|3;a[m+(t|4)>>2]=b|1;a[m+(b+t)>>2]=b;i=a[210]|0;if((i|0)!=0){n=a[213]|0;f=i>>>3;i=f<<1;v=872+(i<<2)|0;c=a[208]|0;o=1<>2]|0;if(h>>>0>=(a[212]|0)>>>0){x=h;A=f;break}ke();return 0}}while(0);a[A>>2]=n;a[x+12>>2]=n;a[n+8>>2]=x;a[n+12>>2]=v}a[210]=b;a[213]=l}i=r+8|0;if((i|0)==0){p=t;break}else{d=i}return d|0}else{if(e>>>0>4294967231){p=-1;break}i=e+11|0;o=i&-8;c=a[209]|0;if((c|0)==0){p=o;break}m=-o|0;f=i>>>8;do{if((f|0)==0){M=0}else{if(o>>>0>16777215){M=31;break}i=(f+1048320|0)>>>16&8;h=f<>>16&4;u=h<>>16&2;E=14-(s|i|h)+(u<>>15)|0;M=o>>>((E+7|0)>>>0)&1|E<<1}}while(0);f=a[1136+(M<<2)>>2]|0;e:do{if((f|0)==0){I=0;T=m;R=0}else{if((M|0)==31){P=0}else{P=25-(M>>>1)|0}r=0;l=m;b=f;v=o<>2]&-8;h=E-o|0;if(h>>>0>>0){if((E|0)==(o|0)){I=b;T=h;R=b;break e}else{B=b;C=h}}else{B=r;C=l}h=a[b+20>>2]|0;E=a[b+16+(v>>>31<<2)>>2]|0;u=(h|0)==0|(h|0)==(E|0)?n:h;if((E|0)==0){I=B;T=C;R=u;break}else{r=B;l=C;b=E;v=v<<1;n=u}}}}while(0);if((R|0)==0&(I|0)==0){f=2<>>12&16;n=f>>>(m>>>0);f=n>>>5&8;v=n>>>(f>>>0);n=v>>>2&4;b=v>>>(n>>>0);v=b>>>1&2;l=b>>>(v>>>0);b=l>>>1&1;O=a[1136+((f|m|n|v|b)+(l>>>(b>>>0))<<2)>>2]|0}else{O=R}if((O|0)==0){N=T;j=I}else{b=O;l=T;v=I;while(1){n=(a[b+4>>2]&-8)-o|0;m=n>>>0>>0;f=m?n:l;n=m?b:v;m=a[b+16>>2]|0;if((m|0)!=0){b=m;l=f;v=n;continue}m=a[b+20>>2]|0;if((m|0)==0){N=f;j=n;break}else{b=m;l=f;v=n}}}if((j|0)==0){p=o;break}if(N>>>0>=((a[210]|0)-o|0)>>>0){p=o;break}v=j;l=a[212]|0;if(v>>>0>>0){ke();return 0}b=v+o|0;c=b;if(v>>>0>=b>>>0){ke();return 0}n=a[j+24>>2]|0;f=a[j+12>>2]|0;do{if((f|0)==(j|0)){m=j+20|0;r=a[m>>2]|0;if((r|0)==0){u=j+16|0;E=a[u>>2]|0;if((E|0)==0){z=0;break}else{L=E;H=u}}else{L=r;H=m}while(1){m=L+20|0;r=a[m>>2]|0;if((r|0)!=0){L=r;H=m;continue}m=L+16|0;r=a[m>>2]|0;if((r|0)==0){break}else{L=r;H=m}}if(H>>>0>>0){ke();return 0}else{a[H>>2]=0;z=L;break}}else{m=a[j+8>>2]|0;if(m>>>0>>0){ke();return 0}r=m+12|0;if((a[r>>2]|0)!=(j|0)){ke();return 0}u=f+8|0;if((a[u>>2]|0)==(j|0)){a[r>>2]=f;a[u>>2]=m;z=f;break}else{ke();return 0}}}while(0);e:do{if((n|0)!=0){f=j+28|0;l=1136+(a[f>>2]<<2)|0;do{if((j|0)==(a[l>>2]|0)){a[l>>2]=z;if((z|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(n>>>0<(a[212]|0)>>>0){ke();return 0}m=n+16|0;if((a[m>>2]|0)==(j|0)){a[m>>2]=z}else{a[n+20>>2]=z}if((z|0)==0){break e}}}while(0);if(z>>>0<(a[212]|0)>>>0){ke();return 0}a[z+24>>2]=n;f=a[j+16>>2]|0;do{if((f|0)!=0){if(f>>>0<(a[212]|0)>>>0){ke();return 0}else{a[z+16>>2]=f;a[f+24>>2]=z;break}}}while(0);f=a[j+20>>2]|0;if((f|0)==0){break}if(f>>>0<(a[212]|0)>>>0){ke();return 0}else{a[z+20>>2]=f;a[f+24>>2]=z;break}}}while(0);do{if(N>>>0<16){n=N+o|0;a[j+4>>2]=n|3;f=v+(n+4)|0;a[f>>2]=a[f>>2]|1}else{a[j+4>>2]=o|3;a[v+(o|4)>>2]=N|1;a[v+(N+o)>>2]=N;f=N>>>3;if(N>>>0<256){n=f<<1;l=872+(n<<2)|0;m=a[208]|0;u=1<>2]|0;if(r>>>0>=(a[212]|0)>>>0){F=r;U=f;break}ke();return 0}}while(0);a[U>>2]=c;a[F+12>>2]=c;a[v+(o+8)>>2]=F;a[v+(o+12)>>2]=l;break}n=b;u=N>>>8;do{if((u|0)==0){D=0}else{if(N>>>0>16777215){D=31;break}m=(u+1048320|0)>>>16&8;f=u<>>16&4;E=f<>>16&2;h=14-(r|m|f)+(E<>>15)|0;D=N>>>((h+7|0)>>>0)&1|h<<1}}while(0);u=1136+(D<<2)|0;a[v+(o+28)>>2]=D;a[v+(o+20)>>2]=0;a[v+(o+16)>>2]=0;l=a[209]|0;h=1<>2]=n;a[v+(o+24)>>2]=u;a[v+(o+12)>>2]=n;a[v+(o+8)>>2]=n;break}if((D|0)==31){q=0}else{q=25-(D>>>1)|0}h=N<>2]|0;while(1){if((a[l+4>>2]&-8|0)==(N|0)){break}K=l+16+(h>>>31<<2)|0;u=a[K>>2]|0;if((u|0)==0){Y=262;break}else{h=h<<1;l=u}}if((Y|0)==262){if(K>>>0<(a[212]|0)>>>0){ke();return 0}else{a[K>>2]=n;a[v+(o+24)>>2]=l;a[v+(o+12)>>2]=n;a[v+(o+8)>>2]=n;break}}h=l+8|0;u=a[h>>2]|0;f=a[212]|0;if(l>>>0>>0){ke();return 0}if(u>>>0>>0){ke();return 0}else{a[u+12>>2]=n;a[h>>2]=n;a[v+(o+8)>>2]=u;a[v+(o+12)>>2]=l;a[v+(o+24)>>2]=0;break}}}while(0);v=j+8|0;if((v|0)==0){p=o;break}else{d=v}return d|0}}while(0);j=a[210]|0;if(p>>>0<=j>>>0){K=j-p|0;N=a[213]|0;if(K>>>0>15){q=N;a[213]=q+p;a[210]=K;a[q+(p+4)>>2]=K|1;a[q+j>>2]=K;a[N+4>>2]=p|3}else{a[210]=0;a[213]=0;a[N+4>>2]=j|3;K=N+(j+4)|0;a[K>>2]=a[K>>2]|1}d=N+8|0;return d|0}N=a[211]|0;if(p>>>0>>0){K=N-p|0;a[211]=K;N=a[214]|0;j=N;a[214]=j+p;a[j+(p+4)>>2]=K|1;a[N+4>>2]=p|3;d=N+8|0;return d|0}do{if((a[200]|0)==0){N=we(8)|0;if((N-1&N|0)==0){a[202]=N;a[201]=N;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);N=p+48|0;K=a[202]|0;j=p+47|0;q=K+j|0;D=-K|0;K=q&D;if(K>>>0<=p>>>0){d=0;return d|0}F=a[318]|0;do{if((F|0)!=0){U=a[316]|0;z=U+K|0;if(z>>>0<=U>>>0|z>>>0>F>>>0){d=0}else{break}return d|0}}while(0);e:do{if((a[319]&4|0)==0){F=a[214]|0;t:do{if((F|0)==0){Y=292}else{z=F;U=1280;while(1){V=U|0;L=a[V>>2]|0;if(L>>>0<=z>>>0){W=U+4|0;if((L+(a[W>>2]|0)|0)>>>0>z>>>0){break}}L=a[U+8>>2]|0;if((L|0)==0){Y=292;break t}else{U=L}}if((U|0)==0){Y=292;break}z=q-(a[211]|0)&D;if(z>>>0>=2147483647){X=0;break}l=Ge(z|0)|0;n=(l|0)==((a[V>>2]|0)+(a[W>>2]|0)|0);Z=n?l:-1;G=n?z:0;Q=l;$=z;Y=301}}while(0);do{if((Y|0)==292){F=Ge(0)|0;if((F|0)==-1){X=0;break}o=F;z=a[201]|0;l=z-1|0;if((l&o|0)==0){J=K}else{J=K-o+(l+o&-z)|0}z=a[316]|0;o=z+J|0;if(!(J>>>0>p>>>0&J>>>0<2147483647)){X=0;break}l=a[318]|0;if((l|0)!=0){if(o>>>0<=z>>>0|o>>>0>l>>>0){X=0;break}}l=Ge(J|0)|0;o=(l|0)==(F|0);Z=o?F:-1;G=o?J:0;Q=l;$=J;Y=301}}while(0);t:do{if((Y|0)==301){l=-$|0;if((Z|0)!=-1){ee=G;te=Z;Y=312;break e}do{if((Q|0)!=-1&$>>>0<2147483647&$>>>0>>0){o=a[202]|0;F=j-$+o&-o;if(F>>>0>=2147483647){re=$;break}if((Ge(F|0)|0)==-1){Ge(l|0)|0;X=G;break t}else{re=F+$|0;break}}else{re=$}}while(0);if((Q|0)==-1){X=G}else{ee=re;te=Q;Y=312;break e}}}while(0);a[319]=a[319]|4;ne=X;Y=309}else{ne=0;Y=309}}while(0);do{if((Y|0)==309){if(K>>>0>=2147483647){break}X=Ge(K|0)|0;Q=Ge(0)|0;if(!((Q|0)!=-1&(X|0)!=-1&X>>>0>>0)){break}re=Q-X|0;Q=re>>>0>(p+40|0)>>>0;G=Q?X:-1;if((G|0)!=-1){ee=Q?re:ne;te=G;Y=312}}}while(0);do{if((Y|0)==312){ne=(a[316]|0)+ee|0;a[316]=ne;if(ne>>>0>(a[317]|0)>>>0){a[317]=ne}ne=a[214]|0;e:do{if((ne|0)==0){K=a[212]|0;if((K|0)==0|te>>>0>>0){a[212]=te}a[320]=te;a[321]=ee;a[323]=0;a[217]=a[200];a[216]=-1;K=0;do{G=K<<1;re=872+(G<<2)|0;a[872+(G+3<<2)>>2]=re;a[872+(G+2<<2)>>2]=re;K=K+1|0}while(K>>>0<32);K=te+8|0;if((K&7|0)==0){ie=0}else{ie=-K&7}K=ee-40-ie|0;a[214]=te+ie;a[211]=K;a[te+(ie+4)>>2]=K|1;a[te+(ee-36)>>2]=40;a[215]=a[204]}else{K=1280;while(1){ae=a[K>>2]|0;oe=K+4|0;se=a[oe>>2]|0;if((te|0)==(ae+se|0)){Y=324;break}re=a[K+8>>2]|0;if((re|0)==0){break}else{K=re}}do{if((Y|0)==324){if((a[K+12>>2]&8|0)!=0){break}re=ne;if(!(re>>>0>=ae>>>0&re>>>0>>0)){break}a[oe>>2]=se+ee;re=a[214]|0;G=(a[211]|0)+ee|0;Q=re;X=re+8|0;if((X&7|0)==0){fe=0}else{fe=-X&7}X=G-fe|0;a[214]=Q+fe;a[211]=X;a[Q+(fe+4)>>2]=X|1;a[Q+(G+4)>>2]=40;a[215]=a[204];break e}}while(0);if(te>>>0<(a[212]|0)>>>0){a[212]=te}K=te+ee|0;G=1280;while(1){ue=G|0;if((a[ue>>2]|0)==(K|0)){Y=334;break}Q=a[G+8>>2]|0;if((Q|0)==0){break}else{G=Q}}do{if((Y|0)==334){if((a[G+12>>2]&8|0)!=0){break}a[ue>>2]=te;K=G+4|0;a[K>>2]=(a[K>>2]|0)+ee;K=te+8|0;if((K&7|0)==0){ce=0}else{ce=-K&7}K=te+(ee+8)|0;if((K&7|0)==0){he=0}else{he=-K&7}K=te+(he+ee)|0;Q=K;X=ce+p|0;re=te+X|0;$=re;j=K-(te+ce)-p|0;a[te+(ce+4)>>2]=p|3;do{if((Q|0)==(a[214]|0)){N=(a[211]|0)+j|0;a[211]=N;a[214]=$;a[te+(X+4)>>2]=N|1}else{if((Q|0)==(a[213]|0)){N=(a[210]|0)+j|0;a[210]=N;a[213]=$;a[te+(X+4)>>2]=N|1;a[te+(N+X)>>2]=N;break}N=ee+4|0;Z=a[te+(N+he)>>2]|0;if((Z&3|0)==1){J=Z&-8;W=Z>>>3;t:do{if(Z>>>0<256){V=a[te+((he|8)+ee)>>2]|0;D=a[te+(ee+12+he)>>2]|0;q=872+(W<<1<<2)|0;do{if((V|0)!=(q|0)){if(V>>>0<(a[212]|0)>>>0){ke();return 0}if((a[V+12>>2]|0)==(Q|0)){break}ke();return 0}}while(0);if((D|0)==(V|0)){a[208]=a[208]&~(1<>>0<(a[212]|0)>>>0){ke();return 0}l=D+8|0;if((a[l>>2]|0)==(Q|0)){le=l;break}ke();return 0}}while(0);a[V+12>>2]=D;a[le>>2]=V}else{q=K;l=a[te+((he|24)+ee)>>2]|0;U=a[te+(ee+12+he)>>2]|0;do{if((U|0)==(q|0)){F=he|16;o=te+(N+F)|0;z=a[o>>2]|0;if((z|0)==0){n=te+(F+ee)|0;F=a[n>>2]|0;if((F|0)==0){de=0;break}else{pe=F;be=n}}else{pe=z;be=o}while(1){o=pe+20|0;z=a[o>>2]|0;if((z|0)!=0){pe=z;be=o;continue}o=pe+16|0;z=a[o>>2]|0;if((z|0)==0){break}else{pe=z;be=o}}if(be>>>0<(a[212]|0)>>>0){ke();return 0}else{a[be>>2]=0;de=pe;break}}else{o=a[te+((he|8)+ee)>>2]|0;if(o>>>0<(a[212]|0)>>>0){ke();return 0}z=o+12|0;if((a[z>>2]|0)!=(q|0)){ke();return 0}n=U+8|0;if((a[n>>2]|0)==(q|0)){a[z>>2]=U;a[n>>2]=o;de=U;break}else{ke();return 0}}}while(0);if((l|0)==0){break}U=te+(ee+28+he)|0;V=1136+(a[U>>2]<<2)|0;do{if((q|0)==(a[V>>2]|0)){a[V>>2]=de;if((de|0)!=0){break}a[209]=a[209]&~(1<>2]);break t}else{if(l>>>0<(a[212]|0)>>>0){ke();return 0}D=l+16|0;if((a[D>>2]|0)==(q|0)){a[D>>2]=de}else{a[l+20>>2]=de}if((de|0)==0){break t}}}while(0);if(de>>>0<(a[212]|0)>>>0){ke();return 0}a[de+24>>2]=l;q=he|16;U=a[te+(q+ee)>>2]|0;do{if((U|0)!=0){if(U>>>0<(a[212]|0)>>>0){ke();return 0}else{a[de+16>>2]=U;a[U+24>>2]=de;break}}}while(0);U=a[te+(N+q)>>2]|0;if((U|0)==0){break}if(U>>>0<(a[212]|0)>>>0){ke();return 0}else{a[de+20>>2]=U;a[U+24>>2]=de;break}}}while(0);ve=te+((J|he)+ee)|0;me=J+j|0}else{ve=Q;me=j}N=ve+4|0;a[N>>2]=a[N>>2]&-2;a[te+(X+4)>>2]=me|1;a[te+(me+X)>>2]=me;N=me>>>3;if(me>>>0<256){W=N<<1;Z=872+(W<<2)|0;U=a[208]|0;l=1<>2]|0;if(V>>>0>=(a[212]|0)>>>0){ge=V;ye=N;break}ke();return 0}}while(0);a[ye>>2]=$;a[ge+12>>2]=$;a[te+(X+8)>>2]=ge;a[te+(X+12)>>2]=Z;break}W=re;l=me>>>8;do{if((l|0)==0){_e=0}else{if(me>>>0>16777215){_e=31;break}U=(l+1048320|0)>>>16&8;J=l<>>16&4;V=J<>>16&2;D=14-(N|U|J)+(V<>>15)|0;_e=me>>>((D+7|0)>>>0)&1|D<<1}}while(0);l=1136+(_e<<2)|0;a[te+(X+28)>>2]=_e;a[te+(X+20)>>2]=0;a[te+(X+16)>>2]=0;Z=a[209]|0;D=1<<_e;if((Z&D|0)==0){a[209]=Z|D;a[l>>2]=W;a[te+(X+24)>>2]=l;a[te+(X+12)>>2]=W;a[te+(X+8)>>2]=W;break}if((_e|0)==31){Se=0}else{Se=25-(_e>>>1)|0}D=me<>2]|0;while(1){if((a[Z+4>>2]&-8|0)==(me|0)){break}xe=Z+16+(D>>>31<<2)|0;l=a[xe>>2]|0;if((l|0)==0){Y=407;break}else{D=D<<1;Z=l}}if((Y|0)==407){if(xe>>>0<(a[212]|0)>>>0){ke();return 0}else{a[xe>>2]=W;a[te+(X+24)>>2]=Z;a[te+(X+12)>>2]=W;a[te+(X+8)>>2]=W;break}}D=Z+8|0;l=a[D>>2]|0;J=a[212]|0;if(Z>>>0>>0){ke();return 0}if(l>>>0>>0){ke();return 0}else{a[l+12>>2]=W;a[D>>2]=W;a[te+(X+8)>>2]=l;a[te+(X+12)>>2]=Z;a[te+(X+24)>>2]=0;break}}}while(0);d=te+(ce|8)|0;return d|0}}while(0);G=ne;X=1280;while(1){Ae=a[X>>2]|0;if(Ae>>>0<=G>>>0){Me=a[X+4>>2]|0;Ee=Ae+Me|0;if(Ee>>>0>G>>>0){break}}X=a[X+8>>2]|0}X=Ae+(Me-39)|0;if((X&7|0)==0){Ie=0}else{Ie=-X&7}X=Ae+(Me-47+Ie)|0;re=X>>>0<(ne+16|0)>>>0?G:X;X=re+8|0;$=te+8|0;if(($&7|0)==0){Te=0}else{Te=-$&7}$=ee-40-Te|0;a[214]=te+Te;a[211]=$;a[te+(Te+4)>>2]=$|1;a[te+(ee-36)>>2]=40;a[215]=a[204];a[re+4>>2]=27;a[X>>2]=a[320];a[X+4>>2]=a[1284>>2];a[X+8>>2]=a[1288>>2];a[X+12>>2]=a[1292>>2];a[320]=te;a[321]=ee;a[323]=0;a[322]=X;X=re+28|0;a[X>>2]=7;if((re+32|0)>>>0>>0){$=X;while(1){X=$+4|0;a[X>>2]=7;if(($+8|0)>>>0>>0){$=X}else{break}}}if((re|0)==(G|0)){break}$=re-ne|0;X=G+($+4)|0;a[X>>2]=a[X>>2]&-2;a[ne+4>>2]=$|1;a[G+$>>2]=$;X=$>>>3;if($>>>0<256){j=X<<1;Q=872+(j<<2)|0;K=a[208]|0;l=1<>2]|0;if(D>>>0>=(a[212]|0)>>>0){Re=D;Pe=X;break}ke();return 0}}while(0);a[Pe>>2]=ne;a[Re+12>>2]=ne;a[ne+8>>2]=Re;a[ne+12>>2]=Q;break}j=ne;l=$>>>8;do{if((l|0)==0){Be=0}else{if($>>>0>16777215){Be=31;break}K=(l+1048320|0)>>>16&8;G=l<>>16&4;X=G<>>16&2;D=14-(re|K|G)+(X<>>15)|0;Be=$>>>((D+7|0)>>>0)&1|D<<1}}while(0);l=1136+(Be<<2)|0;a[ne+28>>2]=Be;a[ne+20>>2]=0;a[ne+16>>2]=0;Q=a[209]|0;D=1<>2]=j;a[ne+24>>2]=l;a[ne+12>>2]=ne;a[ne+8>>2]=ne;break}if((Be|0)==31){Ce=0}else{Ce=25-(Be>>>1)|0}D=$<>2]|0;while(1){if((a[Q+4>>2]&-8|0)==($|0)){break}Oe=Q+16+(D>>>31<<2)|0;l=a[Oe>>2]|0;if((l|0)==0){Y=442;break}else{D=D<<1;Q=l}}if((Y|0)==442){if(Oe>>>0<(a[212]|0)>>>0){ke();return 0}else{a[Oe>>2]=j;a[ne+24>>2]=Q;a[ne+12>>2]=ne;a[ne+8>>2]=ne;break}}D=Q+8|0;$=a[D>>2]|0;l=a[212]|0;if(Q>>>0>>0){ke();return 0}if($>>>0>>0){ke();return 0}else{a[$+12>>2]=j;a[D>>2]=j;a[ne+8>>2]=$;a[ne+12>>2]=Q;a[ne+24>>2]=0;break}}}while(0);ne=a[211]|0;if(ne>>>0<=p>>>0){break}$=ne-p|0;a[211]=$;ne=a[214]|0;D=ne;a[214]=D+p;a[D+(p+4)>>2]=$|1;a[ne+4>>2]=p|3;d=ne+8|0;return d|0}}while(0);a[($e()|0)>>2]=12;d=0;return d|0}function Yt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,H=0,F=0;if((e|0)==0){return}t=e-8|0;r=t;n=a[212]|0;if(t>>>0>>0){ke()}i=a[e-4>>2]|0;o=i&3;if((o|0)==1){ke()}s=i&-8;f=e+(s-8)|0;u=f;e:do{if((i&1|0)==0){c=a[t>>2]|0;if((o|0)==0){return}h=-8-c|0;l=e+h|0;d=l;p=c+s|0;if(l>>>0>>0){ke()}if((d|0)==(a[213]|0)){b=e+(s-4)|0;if((a[b>>2]&3|0)!=3){v=d;m=p;break}a[210]=p;a[b>>2]=a[b>>2]&-2;a[e+(h+4)>>2]=p|1;a[f>>2]=p;return}b=c>>>3;if(c>>>0<256){c=a[e+(h+8)>>2]|0;g=a[e+(h+12)>>2]|0;y=872+(b<<1<<2)|0;do{if((c|0)!=(y|0)){if(c>>>0>>0){ke()}if((a[c+12>>2]|0)==(d|0)){break}ke()}}while(0);if((g|0)==(c|0)){a[208]=a[208]&~(1<>>0>>0){ke()}_=g+8|0;if((a[_>>2]|0)==(d|0)){w=_;break}ke()}}while(0);a[c+12>>2]=g;a[w>>2]=c;v=d;m=p;break}y=l;b=a[e+(h+24)>>2]|0;_=a[e+(h+12)>>2]|0;do{if((_|0)==(y|0)){S=e+(h+20)|0;k=a[S>>2]|0;if((k|0)==0){x=e+(h+16)|0;A=a[x>>2]|0;if((A|0)==0){M=0;break}else{E=A;I=x}}else{E=k;I=S}while(1){S=E+20|0;k=a[S>>2]|0;if((k|0)!=0){E=k;I=S;continue}S=E+16|0;k=a[S>>2]|0;if((k|0)==0){break}else{E=k;I=S}}if(I>>>0>>0){ke()}else{a[I>>2]=0;M=E;break}}else{S=a[e+(h+8)>>2]|0;if(S>>>0>>0){ke()}k=S+12|0;if((a[k>>2]|0)!=(y|0)){ke()}x=_+8|0;if((a[x>>2]|0)==(y|0)){a[k>>2]=_;a[x>>2]=S;M=_;break}else{ke()}}}while(0);if((b|0)==0){v=d;m=p;break}_=e+(h+28)|0;l=1136+(a[_>>2]<<2)|0;do{if((y|0)==(a[l>>2]|0)){a[l>>2]=M;if((M|0)!=0){break}a[209]=a[209]&~(1<>2]);v=d;m=p;break e}else{if(b>>>0<(a[212]|0)>>>0){ke()}c=b+16|0;if((a[c>>2]|0)==(y|0)){a[c>>2]=M}else{a[b+20>>2]=M}if((M|0)==0){v=d;m=p;break e}}}while(0);if(M>>>0<(a[212]|0)>>>0){ke()}a[M+24>>2]=b;y=a[e+(h+16)>>2]|0;do{if((y|0)!=0){if(y>>>0<(a[212]|0)>>>0){ke()}else{a[M+16>>2]=y;a[y+24>>2]=M;break}}}while(0);y=a[e+(h+20)>>2]|0;if((y|0)==0){v=d;m=p;break}if(y>>>0<(a[212]|0)>>>0){ke()}else{a[M+20>>2]=y;a[y+24>>2]=M;v=d;m=p;break}}else{v=r;m=s}}while(0);r=v;if(r>>>0>=f>>>0){ke()}M=e+(s-4)|0;n=a[M>>2]|0;if((n&1|0)==0){ke()}do{if((n&2|0)==0){if((u|0)==(a[214]|0)){E=(a[211]|0)+m|0;a[211]=E;a[214]=v;a[v+4>>2]=E|1;if((v|0)==(a[213]|0)){a[213]=0;a[210]=0}if(E>>>0<=(a[215]|0)>>>0){return}Qt(0)|0;return}if((u|0)==(a[213]|0)){E=(a[210]|0)+m|0;a[210]=E;a[213]=v;a[v+4>>2]=E|1;a[r+E>>2]=E;return}E=(n&-8)+m|0;I=n>>>3;e:do{if(n>>>0<256){w=a[e+s>>2]|0;o=a[e+(s|4)>>2]|0;t=872+(I<<1<<2)|0;do{if((w|0)!=(t|0)){if(w>>>0<(a[212]|0)>>>0){ke()}if((a[w+12>>2]|0)==(u|0)){break}ke()}}while(0);if((o|0)==(w|0)){a[208]=a[208]&~(1<>>0<(a[212]|0)>>>0){ke()}i=o+8|0;if((a[i>>2]|0)==(u|0)){T=i;break}ke()}}while(0);a[w+12>>2]=o;a[T>>2]=w}else{t=f;i=a[e+(s+16)>>2]|0;y=a[e+(s|4)>>2]|0;do{if((y|0)==(t|0)){b=e+(s+12)|0;_=a[b>>2]|0;if((_|0)==0){l=e+(s+8)|0;c=a[l>>2]|0;if((c|0)==0){R=0;break}else{P=c;B=l}}else{P=_;B=b}while(1){b=P+20|0;_=a[b>>2]|0;if((_|0)!=0){P=_;B=b;continue}b=P+16|0;_=a[b>>2]|0;if((_|0)==0){break}else{P=_;B=b}}if(B>>>0<(a[212]|0)>>>0){ke()}else{a[B>>2]=0;R=P;break}}else{b=a[e+s>>2]|0;if(b>>>0<(a[212]|0)>>>0){ke()}_=b+12|0;if((a[_>>2]|0)!=(t|0)){ke()}l=y+8|0;if((a[l>>2]|0)==(t|0)){a[_>>2]=y;a[l>>2]=b;R=y;break}else{ke()}}}while(0);if((i|0)==0){break}y=e+(s+20)|0;w=1136+(a[y>>2]<<2)|0;do{if((t|0)==(a[w>>2]|0)){a[w>>2]=R;if((R|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(i>>>0<(a[212]|0)>>>0){ke()}o=i+16|0;if((a[o>>2]|0)==(t|0)){a[o>>2]=R}else{a[i+20>>2]=R}if((R|0)==0){break e}}}while(0);if(R>>>0<(a[212]|0)>>>0){ke()}a[R+24>>2]=i;t=a[e+(s+8)>>2]|0;do{if((t|0)!=0){if(t>>>0<(a[212]|0)>>>0){ke()}else{a[R+16>>2]=t;a[t+24>>2]=R;break}}}while(0);t=a[e+(s+12)>>2]|0;if((t|0)==0){break}if(t>>>0<(a[212]|0)>>>0){ke()}else{a[R+20>>2]=t;a[t+24>>2]=R;break}}}while(0);a[v+4>>2]=E|1;a[r+E>>2]=E;if((v|0)!=(a[213]|0)){C=E;break}a[210]=E;return}else{a[M>>2]=n&-2;a[v+4>>2]=m|1;a[r+m>>2]=m;C=m}}while(0);m=C>>>3;if(C>>>0<256){r=m<<1;n=872+(r<<2)|0;M=a[208]|0;R=1<>2]|0;if(s>>>0>=(a[212]|0)>>>0){O=s;N=m;break}ke()}}while(0);a[N>>2]=v;a[O+12>>2]=v;a[v+8>>2]=O;a[v+12>>2]=n;return}n=v;O=C>>>8;do{if((O|0)==0){j=0}else{if(C>>>0>16777215){j=31;break}N=(O+1048320|0)>>>16&8;r=O<>>16&4;M=r<>>16&2;m=14-(R|N|r)+(M<>>15)|0;j=C>>>((m+7|0)>>>0)&1|m<<1}}while(0);O=1136+(j<<2)|0;a[v+28>>2]=j;a[v+20>>2]=0;a[v+16>>2]=0;m=a[209]|0;r=1<>2]=n;a[v+24>>2]=O;a[v+12>>2]=v;a[v+8>>2]=v}else{if((j|0)==31){z=0}else{z=25-(j>>>1)|0}M=C<>2]|0;while(1){if((a[N+4>>2]&-8|0)==(C|0)){break}L=N+16+(M>>>31<<2)|0;R=a[L>>2]|0;if((R|0)==0){H=621;break}else{M=M<<1;N=R}}if((H|0)==621){if(L>>>0<(a[212]|0)>>>0){ke()}else{a[L>>2]=n;a[v+24>>2]=N;a[v+12>>2]=v;a[v+8>>2]=v;break}}M=N+8|0;E=a[M>>2]|0;R=a[212]|0;if(N>>>0>>0){ke()}if(E>>>0>>0){ke()}else{a[E+12>>2]=n;a[M>>2]=n;a[v+8>>2]=E;a[v+12>>2]=N;a[v+24>>2]=0;break}}}while(0);v=(a[216]|0)-1|0;a[216]=v;if((v|0)==0){F=1288}else{return}while(1){v=a[F>>2]|0;if((v|0)==0){break}else{F=v+8|0}}a[216]=-1;return}function Vt(e,t){e=e|0;t=t|0;var r=0,n=0;do{if((e|0)==0){r=0}else{n=oe(t,e)|0;if((t|e)>>>0<=65535){r=n;break}r=((n>>>0)/(e>>>0)|0|0)==(t|0)?n:-1}}while(0);t=Kt(r)|0;if((t|0)==0){return t|0}if((a[t-4>>2]&3|0)==0){return t|0}en(t|0,0,r|0);return t|0}function Wt(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0;if((e|0)==0){r=Kt(t)|0;return r|0}if(t>>>0>4294967231){a[($e()|0)>>2]=12;r=0;return r|0}if(t>>>0<11){n=16}else{n=t+11&-8}i=$t(e-8|0,n)|0;if((i|0)!=0){r=i+8|0;return r|0}i=Kt(t)|0;if((i|0)==0){r=0;return r|0}n=a[e-4>>2]|0;o=(n&-8)-((n&3|0)==0?8:4)|0;n=o>>>0>>0?o:t;Jr(i|0,e|0,n)|0;Yt(e);r=i;return r|0}function Xt(e,t){e=e|0;t=t|0;var r=0;if((e|0)==0){return 0}if(t>>>0>4294967231){a[($e()|0)>>2]=12;return 0}if(t>>>0<11){r=16}else{r=t+11&-8}t=e-8|0;return(($t(t,r)|0)==(t|0)?e:0)|0}function Zt(e,t){e=e|0;t=t|0;var r=0;if(e>>>0<9){r=Kt(t)|0;return r|0}else{r=Gt(e,t)|0;return r|0}return 0}function Gt(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0;r=e>>>0<16?16:e;if((r-1&r|0)==0){n=r}else{e=16;while(1){if(e>>>0>>0){e=e<<1}else{n=e;break}}}if((-64-n|0)>>>0<=t>>>0){a[($e()|0)>>2]=12;i=0;return i|0}if(t>>>0<11){o=16}else{o=t+11&-8}t=Kt(n+12+o|0)|0;if((t|0)==0){i=0;return i|0}e=t-8|0;r=e;s=n-1|0;do{if((t&s|0)==0){f=r}else{u=t+s&-n;c=u-8|0;h=e;if((c-h|0)>>>0>15){l=c}else{l=u+(n-8)|0}u=l;c=l-h|0;h=t-4|0;d=a[h>>2]|0;p=(d&-8)-c|0;if((d&3|0)==0){a[l>>2]=(a[e>>2]|0)+c;a[l+4>>2]=p;f=u;break}else{d=l+4|0;a[d>>2]=p|a[d>>2]&1|2;d=l+(p+4)|0;a[d>>2]=a[d>>2]|1;a[h>>2]=c|a[h>>2]&1|2;h=t+(c-4)|0;a[h>>2]=a[h>>2]|1;vr(r,c);f=u;break}}}while(0);r=f+4|0;t=a[r>>2]|0;do{if((t&3|0)!=0){l=t&-8;if(l>>>0<=(o+16|0)>>>0){break}e=l-o|0;n=f;a[r>>2]=o|t&1|2;a[n+(o|4)>>2]=e|3;s=n+(l|4)|0;a[s>>2]=a[s>>2]|1;vr(n+o|0,e)}}while(0);i=f+8|0;return i|0}function Qt(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);if(e>>>0>=4294967232){r=0;return r|0}t=a[214]|0;if((t|0)==0){r=0;return r|0}n=a[211]|0;do{if(n>>>0>(e+40|0)>>>0){i=a[202]|0;o=oe((((-40-e-1+n+i|0)>>>0)/(i>>>0)|0)-1|0,i)|0;s=t;f=1280;while(1){u=a[f>>2]|0;if(u>>>0<=s>>>0){if((u+(a[f+4>>2]|0)|0)>>>0>s>>>0){c=f;break}}u=a[f+8>>2]|0;if((u|0)==0){c=0;break}else{f=u}}if((a[c+12>>2]&8|0)!=0){break}f=Ge(0)|0;s=c+4|0;if((f|0)!=((a[c>>2]|0)+(a[s>>2]|0)|0)){break}u=Ge(-(o>>>0>2147483646?-2147483648-i|0:o)|0)|0;h=Ge(0)|0;if(!((u|0)!=-1&h>>>0>>0)){break}u=f-h|0;if((f|0)==(h|0)){break}a[s>>2]=(a[s>>2]|0)-u;a[316]=(a[316]|0)-u;s=a[214]|0;l=(a[211]|0)-u|0;u=s;d=s+8|0;if((d&7|0)==0){p=0}else{p=-d&7}d=l-p|0;a[214]=u+p;a[211]=d;a[u+(p+4)>>2]=d|1;a[u+(l+4)>>2]=40;a[215]=a[204];r=(f|0)!=(h|0)|0;return r|0}}while(0);if((a[211]|0)>>>0<=(a[215]|0)>>>0){r=0;return r|0}a[215]=-1;r=0;return r|0}function $t(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0;r=e+4|0;n=a[r>>2]|0;i=n&-8;o=e;s=o+i|0;f=s;u=a[212]|0;if(o>>>0>>0){ke();return 0}c=n&3;if(!((c|0)!=1&o>>>0>>0)){ke();return 0}h=o+(i|4)|0;l=a[h>>2]|0;if((l&1|0)==0){ke();return 0}if((c|0)==0){if(t>>>0<256){d=0;return d|0}do{if(i>>>0>=(t+4|0)>>>0){if((i-t|0)>>>0>a[202]<<1>>>0){break}else{d=e}return d|0}}while(0);d=0;return d|0}if(i>>>0>=t>>>0){c=i-t|0;if(c>>>0<=15){d=e;return d|0}a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=c|3;a[h>>2]=a[h>>2]|1;vr(o+t|0,c);d=e;return d|0}if((f|0)==(a[214]|0)){c=(a[211]|0)+i|0;if(c>>>0<=t>>>0){d=0;return d|0}h=c-t|0;a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=h|1;a[214]=o+t;a[211]=h;d=e;return d|0}if((f|0)==(a[213]|0)){h=(a[210]|0)+i|0;if(h>>>0>>0){d=0;return d|0}c=h-t|0;if(c>>>0>15){a[r>>2]=n&1|t|2;a[o+(t+4)>>2]=c|1;a[o+h>>2]=c;p=o+(h+4)|0;a[p>>2]=a[p>>2]&-2;b=o+t|0;v=c}else{a[r>>2]=n&1|h|2;n=o+(h+4)|0;a[n>>2]=a[n>>2]|1;b=0;v=0}a[210]=v;a[213]=b;d=e;return d|0}if((l&2|0)!=0){d=0;return d|0}b=(l&-8)+i|0;if(b>>>0>>0){d=0;return d|0}v=b-t|0;n=l>>>3;e:do{if(l>>>0<256){h=a[o+(i+8)>>2]|0;c=a[o+(i+12)>>2]|0;p=872+(n<<1<<2)|0;do{if((h|0)!=(p|0)){if(h>>>0>>0){ke();return 0}if((a[h+12>>2]|0)==(f|0)){break}ke();return 0}}while(0);if((c|0)==(h|0)){a[208]=a[208]&~(1<>>0>>0){ke();return 0}g=c+8|0;if((a[g>>2]|0)==(f|0)){m=g;break}ke();return 0}}while(0);a[h+12>>2]=c;a[m>>2]=h}else{p=s;g=a[o+(i+24)>>2]|0;y=a[o+(i+12)>>2]|0;do{if((y|0)==(p|0)){w=o+(i+20)|0;_=a[w>>2]|0;if((_|0)==0){S=o+(i+16)|0;k=a[S>>2]|0;if((k|0)==0){x=0;break}else{A=k;M=S}}else{A=_;M=w}while(1){w=A+20|0;_=a[w>>2]|0;if((_|0)!=0){A=_;M=w;continue}w=A+16|0;_=a[w>>2]|0;if((_|0)==0){break}else{A=_;M=w}}if(M>>>0>>0){ke();return 0}else{a[M>>2]=0;x=A;break}}else{w=a[o+(i+8)>>2]|0;if(w>>>0>>0){ke();return 0}_=w+12|0;if((a[_>>2]|0)!=(p|0)){ke();return 0}S=y+8|0;if((a[S>>2]|0)==(p|0)){a[_>>2]=y;a[S>>2]=w;x=y;break}else{ke();return 0}}}while(0);if((g|0)==0){break}y=o+(i+28)|0;h=1136+(a[y>>2]<<2)|0;do{if((p|0)==(a[h>>2]|0)){a[h>>2]=x;if((x|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(g>>>0<(a[212]|0)>>>0){ke();return 0}c=g+16|0;if((a[c>>2]|0)==(p|0)){a[c>>2]=x}else{a[g+20>>2]=x}if((x|0)==0){break e}}}while(0);if(x>>>0<(a[212]|0)>>>0){ke();return 0}a[x+24>>2]=g;p=a[o+(i+16)>>2]|0;do{if((p|0)!=0){if(p>>>0<(a[212]|0)>>>0){ke();return 0}else{a[x+16>>2]=p;a[p+24>>2]=x;break}}}while(0);p=a[o+(i+20)>>2]|0;if((p|0)==0){break}if(p>>>0<(a[212]|0)>>>0){ke();return 0}else{a[x+20>>2]=p;a[p+24>>2]=x;break}}}while(0);if(v>>>0<16){a[r>>2]=b|a[r>>2]&1|2;x=o+(b|4)|0;a[x>>2]=a[x>>2]|1;d=e;return d|0}else{a[r>>2]=a[r>>2]&1|t|2;a[o+(t+4)>>2]=v|3;r=o+(b|4)|0;a[r>>2]=a[r>>2]|1;vr(o+t|0,v);d=e;return d|0}return 0}function Jt(){return a[316]|0}function er(){return a[317]|0}function tr(){var e=0;e=a[318]|0;return((e|0)==0?-1:e)|0}function rr(e){e=e|0;var t=0,r=0;if((e|0)==-1){t=0}else{r=a[202]|0;t=e-1+r&-r}a[318]=t;return t|0}function nr(e){e=e|0;var t=0,r=0,n=0;do{if((e|0)==0){t=0}else{r=a[e-4>>2]|0;n=r&3;if((n|0)==1){t=0;break}t=(r&-8)-((n|0)==0?8:4)|0}}while(0);return t|0}function ir(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0,o=0;do{if((t|0)==8){n=Kt(r)|0}else{i=t>>>2;if((t&3|0)!=0|(i|0)==0){o=22;return o|0}if((i+1073741823&i|0)!=0){o=22;return o|0}if((-64-t|0)>>>0>>0){o=12;return o|0}else{n=Gt(t>>>0<16?16:t,r)|0;break}}}while(0);if((n|0)==0){o=12;return o|0}a[e>>2]=n;o=0;return o|0}function ar(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+8|0;i=n|0;a[i>>2]=t;t=ur(e,i,3,r)|0;h=n;return t|0}function or(e,t,r){e=e|0;t=t|0;r=r|0;return ur(e,t,0,r)|0}function sr(e){e=e|0;var t=0,r=0,n=0;if((a[200]|0)!=0){t=a[201]|0;r=Zt(t,e)|0;return r|0}n=we(8)|0;if((n-1&n|0)!=0){ke();return 0}a[202]=n;a[201]=n;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;t=a[201]|0;r=Zt(t,e)|0;return r|0}function fr(e){e=e|0;var t=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);t=a[201]|0;return Zt(t,e-1+t&-t)|0}function ur(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0;do{if((a[200]|0)==0){i=we(8)|0;if((i-1&i|0)==0){a[202]=i;a[201]=i;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);i=(e|0)==0;do{if((n|0)==0){if(i){o=Kt(0)|0;return o|0}else{s=e<<2;if(s>>>0<11){f=0;u=16;break}f=0;u=s+11&-8;break}}else{if(i){o=n}else{f=n;u=0;break}return o|0}}while(0);do{if((r&1|0)==0){if(i){c=0;h=0;break}else{l=0;d=0}while(1){n=a[t+(d<<2)>>2]|0;if(n>>>0<11){p=16}else{p=n+11&-8}n=p+l|0;s=d+1|0;if((s|0)==(e|0)){c=0;h=n;break}else{l=n;d=s}}}else{s=a[t>>2]|0;if(s>>>0<11){b=16}else{b=s+11&-8}c=b;h=oe(b,e)|0}}while(0);b=Kt(u-4+h|0)|0;if((b|0)==0){o=0;return o|0}d=b-8|0;l=a[b-4>>2]&-8;if((r&2|0)!=0){en(b|0,0,-4-u+l|0)}if((f|0)==0){a[b+(h-4)>>2]=l-h|3;v=b+h|0;m=h}else{v=f;m=l}a[v>>2]=b;b=e-1|0;e:do{if((b|0)==0){g=d;y=m}else{if((c|0)==0){w=d;_=m;S=0}else{e=d;l=m;f=0;while(1){h=l-c|0;a[e+4>>2]=c|3;u=e+c|0;r=f+1|0;a[v+(r<<2)>>2]=e+(c+8);if((r|0)==(b|0)){g=u;y=h;break e}else{e=u;l=h;f=r}}}while(1){f=a[t+(S<<2)>>2]|0;if(f>>>0<11){k=16}else{k=f+11&-8}f=_-k|0;a[w+4>>2]=k|3;l=w+k|0;e=S+1|0;a[v+(e<<2)>>2]=w+(k+8);if((e|0)==(b|0)){g=l;y=f;break}else{w=l;_=f;S=e}}}}while(0);a[g+4>>2]=y|3;o=v;return o|0}function cr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0;r=e+(t<<2)|0;e:do{if((t|0)!=0){n=e;t:while(1){i=a[n>>2]|0;r:do{if((i|0)==0){o=n+4|0}else{s=i-8|0;f=s;u=i-4|0;c=a[u>>2]&-8;a[n>>2]=0;if(s>>>0<(a[212]|0)>>>0){h=935;break t}s=a[u>>2]|0;if((s&3|0)==1){h=936;break t}l=n+4|0;d=s-8&-8;do{if((l|0)!=(r|0)){if((a[l>>2]|0)!=(i+(d+8)|0)){break}p=(a[i+(d|4)>>2]&-8)+c|0;a[u>>2]=s&1|p|2;b=i+(p-4)|0;a[b>>2]=a[b>>2]|1;a[l>>2]=i;o=l;break r}}while(0);vr(f,c);o=l}}while(0);if((o|0)==(r|0)){break e}else{n=o}}if((h|0)==935){ke();return 0}else if((h|0)==936){ke();return 0}}}while(0);if((a[211]|0)>>>0<=(a[215]|0)>>>0){return 0}Qt(0)|0;return 0}function hr(e){e=e|0;var t=0,r=0;if((a[200]|0)!=0){t=Qt(e)|0;return t|0}r=we(8)|0;if((r-1&r|0)!=0){ke();return 0}a[202]=r;a[201]=r;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;t=Qt(e)|0;return t|0}function lr(e){e=e|0;var t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke()}}}while(0);t=a[214]|0;if((t|0)==0){r=0;n=0;i=0;o=0;s=0;f=0;u=0}else{c=a[211]|0;h=c+40|0;l=1;d=h;p=h;h=1280;while(1){b=a[h>>2]|0;v=b+8|0;if((v&7|0)==0){m=0}else{m=-v&7}v=b+(a[h+4>>2]|0)|0;g=l;y=d;w=p;_=b+m|0;while(1){if(_>>>0>=v>>>0|(_|0)==(t|0)){S=g;k=y;x=w;break}A=a[_+4>>2]|0;if((A|0)==7){S=g;k=y;x=w;break}M=A&-8;E=M+w|0;if((A&3|0)==1){I=M+y|0;T=g+1|0}else{I=y;T=g}A=_+M|0;if(A>>>0>>0){S=T;k=I;x=E;break}else{g=T;y=I;w=E;_=A}}_=a[h+8>>2]|0;if((_|0)==0){break}else{l=S;d=k;p=x;h=_}}h=a[316]|0;r=c;n=x;i=S;o=h-x|0;s=a[317]|0;f=h-k|0;u=k}a[e>>2]=n;a[e+4>>2]=i;i=e+8|0;a[i>>2]=0;a[i+4>>2]=0;a[e+16>>2]=o;a[e+20>>2]=s;a[e+24>>2]=0;a[e+28>>2]=f;a[e+32>>2]=u;a[e+36>>2]=r;return}function dr(){var e=0,t=0,r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,g=0,y=0,w=0;e=h;do{if((a[200]|0)==0){t=we(8)|0;if((t-1&t|0)==0){a[202]=t;a[201]=t;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke()}}}while(0);t=a[214]|0;if((t|0)==0){r=0;n=0;i=0}else{o=a[317]|0;s=a[316]|0;f=s-40-(a[211]|0)|0;u=1280;while(1){c=a[u>>2]|0;l=c+8|0;if((l&7|0)==0){d=0}else{d=-l&7}l=c+(a[u+4>>2]|0)|0;p=f;b=c+d|0;while(1){if(b>>>0>=l>>>0|(b|0)==(t|0)){v=p;break}g=a[b+4>>2]|0;if((g|0)==7){v=p;break}y=g&-8;w=p-((g&3|0)==1?y:0)|0;g=b+y|0;if(g>>>0>>0){v=w;break}else{p=w;b=g}}b=a[u+8>>2]|0;if((b|0)==0){r=v;n=s;i=o;break}else{f=v;u=b}}}xe(a[m>>2]|0,520,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;xe(a[m>>2]|0,488,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;xe(a[m>>2]|0,400,(E=h,h=h+8|0,a[E>>2]=r,E)|0)|0;h=e;return}function pr(e,t){e=e|0;t=t|0;var r=0,n=0;do{if((a[200]|0)==0){r=we(8)|0;if((r-1&r|0)==0){a[202]=r;a[201]=r;a[203]=-1;a[204]=2097152;a[205]=0;a[319]=0;a[200]=(tt(0)|0)&-16^1431655768;break}else{ke();return 0}}}while(0);if((e|0)==(-1|0)){a[204]=t;n=1;return n|0}else if((e|0)==(-2|0)){if((a[201]|0)>>>0>t>>>0){n=0;return n|0}if((t-1&t|0)!=0){n=0;return n|0}a[202]=t;n=1;return n|0}else if((e|0)==(-3|0)){a[203]=t;n=1;return n|0}else{n=0;return n|0}return 0}function br(){return(O=a[328]|0,a[328]=O+0,O)|0}function vr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0;r=e;n=r+t|0;i=n;o=a[e+4>>2]|0;e:do{if((o&1|0)==0){s=a[e>>2]|0;if((o&3|0)==0){return}f=r+(-s|0)|0;u=f;c=s+t|0;h=a[212]|0;if(f>>>0>>0){ke()}if((u|0)==(a[213]|0)){l=r+(t+4)|0;if((a[l>>2]&3|0)!=3){d=u;p=c;break}a[210]=c;a[l>>2]=a[l>>2]&-2;a[r+(4-s)>>2]=c|1;a[n>>2]=c;return}l=s>>>3;if(s>>>0<256){b=a[r+(8-s)>>2]|0;v=a[r+(12-s)>>2]|0;m=872+(l<<1<<2)|0;do{if((b|0)!=(m|0)){if(b>>>0>>0){ke()}if((a[b+12>>2]|0)==(u|0)){break}ke()}}while(0);if((v|0)==(b|0)){a[208]=a[208]&~(1<>>0>>0){ke()}y=v+8|0;if((a[y>>2]|0)==(u|0)){g=y;break}ke()}}while(0);a[b+12>>2]=v;a[g>>2]=b;d=u;p=c;break}m=f;l=a[r+(24-s)>>2]|0;y=a[r+(12-s)>>2]|0;do{if((y|0)==(m|0)){w=16-s|0;_=r+(w+4)|0;S=a[_>>2]|0;if((S|0)==0){k=r+w|0;w=a[k>>2]|0;if((w|0)==0){x=0;break}else{A=w;M=k}}else{A=S;M=_}while(1){_=A+20|0;S=a[_>>2]|0;if((S|0)!=0){A=S;M=_;continue}_=A+16|0;S=a[_>>2]|0;if((S|0)==0){break}else{A=S;M=_}}if(M>>>0>>0){ke()}else{a[M>>2]=0;x=A;break}}else{_=a[r+(8-s)>>2]|0;if(_>>>0>>0){ke()}S=_+12|0;if((a[S>>2]|0)!=(m|0)){ke()}k=y+8|0;if((a[k>>2]|0)==(m|0)){a[S>>2]=y;a[k>>2]=_;x=y;break}else{ke()}}}while(0);if((l|0)==0){d=u;p=c;break}y=r+(28-s)|0;h=1136+(a[y>>2]<<2)|0;do{if((m|0)==(a[h>>2]|0)){a[h>>2]=x;if((x|0)!=0){break}a[209]=a[209]&~(1<>2]);d=u;p=c;break e}else{if(l>>>0<(a[212]|0)>>>0){ke()}f=l+16|0;if((a[f>>2]|0)==(m|0)){a[f>>2]=x}else{a[l+20>>2]=x}if((x|0)==0){d=u;p=c;break e}}}while(0);if(x>>>0<(a[212]|0)>>>0){ke()}a[x+24>>2]=l;m=16-s|0;y=a[r+m>>2]|0;do{if((y|0)!=0){if(y>>>0<(a[212]|0)>>>0){ke()}else{a[x+16>>2]=y;a[y+24>>2]=x;break}}}while(0);y=a[r+(m+4)>>2]|0;if((y|0)==0){d=u;p=c;break}if(y>>>0<(a[212]|0)>>>0){ke()}else{a[x+20>>2]=y;a[y+24>>2]=x;d=u;p=c;break}}else{d=e;p=t}}while(0);e=a[212]|0;if(n>>>0>>0){ke()}x=r+(t+4)|0;A=a[x>>2]|0;do{if((A&2|0)==0){if((i|0)==(a[214]|0)){M=(a[211]|0)+p|0;a[211]=M;a[214]=d;a[d+4>>2]=M|1;if((d|0)!=(a[213]|0)){return}a[213]=0;a[210]=0;return}if((i|0)==(a[213]|0)){M=(a[210]|0)+p|0;a[210]=M;a[213]=d;a[d+4>>2]=M|1;a[d+M>>2]=M;return}M=(A&-8)+p|0;g=A>>>3;e:do{if(A>>>0<256){o=a[r+(t+8)>>2]|0;y=a[r+(t+12)>>2]|0;s=872+(g<<1<<2)|0;do{if((o|0)!=(s|0)){if(o>>>0>>0){ke()}if((a[o+12>>2]|0)==(i|0)){break}ke()}}while(0);if((y|0)==(o|0)){a[208]=a[208]&~(1<>>0>>0){ke()}l=y+8|0;if((a[l>>2]|0)==(i|0)){E=l;break}ke()}}while(0);a[o+12>>2]=y;a[E>>2]=o}else{s=n;l=a[r+(t+24)>>2]|0;h=a[r+(t+12)>>2]|0;do{if((h|0)==(s|0)){f=r+(t+20)|0;b=a[f>>2]|0;if((b|0)==0){v=r+(t+16)|0;_=a[v>>2]|0;if((_|0)==0){I=0;break}else{T=_;R=v}}else{T=b;R=f}while(1){f=T+20|0;b=a[f>>2]|0;if((b|0)!=0){T=b;R=f;continue}f=T+16|0;b=a[f>>2]|0;if((b|0)==0){break}else{T=b;R=f}}if(R>>>0>>0){ke()}else{a[R>>2]=0;I=T;break}}else{f=a[r+(t+8)>>2]|0;if(f>>>0>>0){ke()}b=f+12|0;if((a[b>>2]|0)!=(s|0)){ke()}v=h+8|0;if((a[v>>2]|0)==(s|0)){a[b>>2]=h;a[v>>2]=f;I=h;break}else{ke()}}}while(0);if((l|0)==0){break}h=r+(t+28)|0;o=1136+(a[h>>2]<<2)|0;do{if((s|0)==(a[o>>2]|0)){a[o>>2]=I;if((I|0)!=0){break}a[209]=a[209]&~(1<>2]);break e}else{if(l>>>0<(a[212]|0)>>>0){ke()}y=l+16|0;if((a[y>>2]|0)==(s|0)){a[y>>2]=I}else{a[l+20>>2]=I}if((I|0)==0){break e}}}while(0);if(I>>>0<(a[212]|0)>>>0){ke()}a[I+24>>2]=l;s=a[r+(t+16)>>2]|0;do{if((s|0)!=0){if(s>>>0<(a[212]|0)>>>0){ke()}else{a[I+16>>2]=s;a[s+24>>2]=I;break}}}while(0);s=a[r+(t+20)>>2]|0;if((s|0)==0){break}if(s>>>0<(a[212]|0)>>>0){ke()}else{a[I+20>>2]=s;a[s+24>>2]=I;break}}}while(0);a[d+4>>2]=M|1;a[d+M>>2]=M;if((d|0)!=(a[213]|0)){P=M;break}a[210]=M;return}else{a[x>>2]=A&-2;a[d+4>>2]=p|1;a[d+p>>2]=p;P=p}}while(0);p=P>>>3;if(P>>>0<256){A=p<<1;x=872+(A<<2)|0;I=a[208]|0;t=1<>2]|0;if(r>>>0>=(a[212]|0)>>>0){B=r;C=p;break}ke()}}while(0);a[C>>2]=d;a[B+12>>2]=d;a[d+8>>2]=B;a[d+12>>2]=x;return}x=d;B=P>>>8;do{if((B|0)==0){O=0}else{if(P>>>0>16777215){O=31;break}C=(B+1048320|0)>>>16&8;A=B<>>16&4;I=A<>>16&2;p=14-(t|C|A)+(I<>>15)|0;O=P>>>((p+7|0)>>>0)&1|p<<1}}while(0);B=1136+(O<<2)|0;a[d+28>>2]=O;a[d+20>>2]=0;a[d+16>>2]=0;p=a[209]|0;A=1<>2]=x;a[d+24>>2]=B;a[d+12>>2]=d;a[d+8>>2]=d;return}if((O|0)==31){N=0}else{N=25-(O>>>1)|0}O=P<>2]|0;while(1){if((a[N+4>>2]&-8|0)==(P|0)){break}j=N+16+(O>>>31<<2)|0;B=a[j>>2]|0;if((B|0)==0){z=1120;break}else{O=O<<1;N=B}}if((z|0)==1120){if(j>>>0<(a[212]|0)>>>0){ke()}a[j>>2]=x;a[d+24>>2]=N;a[d+12>>2]=d;a[d+8>>2]=d;return}j=N+8|0;z=a[j>>2]|0;O=a[212]|0;if(N>>>0>>0){ke()}if(z>>>0>>0){ke()}a[z+12>>2]=x;a[j>>2]=x;a[d+8>>2]=z;a[d+12>>2]=N;a[d+24>>2]=0;return}function mr(e){e=e|0;var t=0,r=0,n=0;t=(e|0)==0?1:e;while(1){r=Kt(t)|0;if((r|0)!=0){n=1164;break}e=(O=a[328]|0,a[328]=O+0,O);if((e|0)==0){break}Cn[e&1]()}if((n|0)==1164){return r|0}r=Le(4)|0;a[r>>2]=560;_e(r|0,688,6);return 0}function gr(e,t){e=e|0;t=t|0;return mr(e)|0}function yr(e){e=e|0;return}function wr(e){e=e|0;return 360|0}function _r(e){e=e|0;return 448|0}function Sr(e){e=e|0;return(O=a[328]|0,a[328]=e,O)|0}function kr(e){e=e|0;a[e>>2]=560;return}function xr(e){e=e|0;a[e>>2]=592;return}function Ar(e){e=e|0;if((e|0)!=0){Yt(e)}return}function Mr(e,t){e=e|0;t=t|0;Ar(e);return}function Er(e){e=e|0;Ar(e);return}function Ir(e,t){e=e|0;t=t|0;Er(e);return}function Tr(e){e=e|0;Ar(e);return}function Rr(e){e=e|0;Ar(e);return}function Pr(e,t,r){e=e|0;t=t|0;r=r|0;return Br(e,t,r,0,0,0)|0}function Br(e,t,r,i,o,s){e=e|0;t=t|0;r=r|0;i=i|0;o=o|0;s=s|0;var f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,H=0,F=0,U=0,D=0,q=0,K=0,Y=0,V=0,W=0,X=0,Z=0,G=0,Q=0,$=0,J=0,ee=0,te=0,re=0,ne=0;f=h;if((r|0)==0){u=-1;h=f;return u|0}c=a[44]|0;if((c|0)==0){a[196]=1;a[44]=1;l=1;d=1;p=1190}else{b=a[196]|0;v=a[74]|0;if((v|0)==-1|(b|0)!=0){l=b;d=c;p=1190}else{m=v;g=b;y=c}}if((p|0)==1190){c=(Ke(344)|0)!=0|0;a[74]=c;m=c;g=l;y=d}d=n[r]|0;if(d<<24>>24==45){w=s|2;p=1194}else{l=(m|0)!=0|d<<24>>24==43?s&-2:s;if(d<<24>>24==43){w=l;p=1194}else{_=r;S=l}}if((p|0)==1194){_=r+1|0;S=w}a[198]=0;if((g|0)==0){k=y;p=1198}else{a[50]=-1;a[48]=-1;x=y;A=g;p=1197}while(1){if((p|0)==1197){p=0;if((A|0)==0){k=x;p=1198;continue}else{M=x}}else if((p|0)==1198){p=0;g=a[40]|0;if((n[g]|0)==0){M=k}else{I=g;T=k;break}}a[196]=0;if((M|0)>=(e|0)){p=1200;break}R=t+(M<<2)|0;P=a[R>>2]|0;a[40]=P;if((n[P]|0)==45){B=P+1|0;C=n[B]|0;if(C<<24>>24!=0){p=1232;break}if((Re(_|0,45)|0)!=0){p=1232;break}}a[40]=824;if((S&2|0)!=0){p=1217;break}if((S&1|0)==0){u=-1;p=1298;break}g=a[48]|0;do{if((g|0)==-1){a[48]=M;O=M;N=0}else{y=a[50]|0;if((y|0)==-1){O=M;N=0;break}w=y-g|0;r=M-y|0;l=(w|0)%(r|0)|0;if((l|0)==0){j=r}else{d=r;s=l;while(1){l=(d|0)%(s|0)|0;if((l|0)==0){j=s;break}else{d=s;s=l}}}s=(M-g|0)/(j|0)|0;do{if((j|0)>0){d=-w|0;if((s|0)>0){z=0}else{L=M;H=y;F=g;U=0;break}do{l=z+y|0;m=t+(l<<2)|0;c=0;b=l;l=a[m>>2]|0;while(1){v=((b|0)<(y|0)?r:d)+b|0;D=t+(v<<2)|0;q=a[D>>2]|0;a[D>>2]=l;a[m>>2]=q;D=c+1|0;if((D|0)<(s|0)){c=D;b=v;l=q}else{break}}z=z+1|0}while((z|0)<(j|0));L=a[44]|0;H=a[50]|0;F=a[48]|0;U=a[196]|0}else{L=M;H=y;F=g;U=0}}while(0);a[48]=L-H+F;a[50]=-1;O=L;N=U}}while(0);g=O+1|0;a[44]=g;x=g;A=N;p=1197}do{if((p|0)==1298){h=f;return u|0}else if((p|0)==1232){N=a[48]|0;A=a[50]|0;if((N|0)!=-1&(A|0)==-1){a[50]=M;K=n[B]|0;Y=M}else{K=C;Y=A}if(K<<24>>24==0){I=P;T=M;break}a[40]=B;if((n[B]|0)!=45){I=B;T=M;break}if((n[P+2|0]|0)!=0){I=B;T=M;break}A=M+1|0;a[44]=A;a[40]=824;if((Y|0)!=-1){x=Y-N|0;O=A-Y|0;U=(x|0)%(O|0)|0;if((U|0)==0){V=O}else{L=O;F=U;while(1){U=(L|0)%(F|0)|0;if((U|0)==0){V=F;break}else{L=F;F=U}}}F=(A-N|0)/(V|0)|0;do{if((V|0)>0){L=-x|0;if((F|0)>0){W=0}else{X=Y;Z=N;G=A;break}do{U=W+Y|0;H=t+(U<<2)|0;j=0;z=U;U=a[H>>2]|0;while(1){k=((z|0)<(Y|0)?O:L)+z|0;g=t+(k<<2)|0;y=a[g>>2]|0;a[g>>2]=U;a[H>>2]=y;g=j+1|0;if((g|0)<(F|0)){j=g;z=k;U=y}else{break}}W=W+1|0}while((W|0)<(V|0));X=a[50]|0;Z=a[48]|0;G=a[44]|0}else{X=Y;Z=N;G=A}}while(0);a[44]=Z-X+G}a[50]=-1;a[48]=-1;u=-1;h=f;return u|0}else if((p|0)==1200){a[40]=824;A=a[50]|0;N=a[48]|0;do{if((A|0)==-1){if((N|0)==-1){break}a[44]=N}else{F=A-N|0;O=M-A|0;x=(F|0)%(O|0)|0;if((x|0)==0){Q=O}else{L=O;U=x;while(1){x=(L|0)%(U|0)|0;if((x|0)==0){Q=U;break}else{L=U;U=x}}}U=(M-N|0)/(Q|0)|0;do{if((Q|0)>0){L=-F|0;if((U|0)>0){$=0}else{J=A;ee=N;te=M;break}do{x=$+A|0;z=t+(x<<2)|0;j=0;H=x;x=a[z>>2]|0;while(1){y=((H|0)<(A|0)?O:L)+H|0;k=t+(y<<2)|0;g=a[k>>2]|0;a[k>>2]=x;a[z>>2]=g;k=j+1|0;if((k|0)<(U|0)){j=k;H=y;x=g}else{break}}$=$+1|0}while(($|0)<(Q|0));J=a[50]|0;ee=a[48]|0;te=a[44]|0}else{J=A;ee=N;te=M}}while(0);a[44]=ee-J+te}}while(0);a[50]=-1;a[48]=-1;u=-1;h=f;return u|0}else if((p|0)==1217){a[44]=M+1;a[198]=a[R>>2];u=1;h=f;return u|0}}while(0);R=(i|0)!=0;e:do{if(R){if((I|0)==(a[t+(T<<2)>>2]|0)){re=I;break}M=n[I]|0;do{if(M<<24>>24==45){a[40]=I+1;ne=0}else{if((S&4|0)==0){re=I;break e}if(M<<24>>24==58){ne=0;break}ne=(Re(_|0,M<<24>>24|0)|0)!=0|0}}while(0);M=Lr(t,_,i,o,ne)|0;if((M|0)==-1){re=a[40]|0;break}a[40]=824;u=M;h=f;return u|0}else{re=I}}while(0);I=re+1|0;a[40]=I;ne=n[re]|0;re=ne<<24>>24;if((ne<<24>>24|0)==45){if((n[I]|0)==0){p=1260}}else if((ne<<24>>24|0)==58){p=1263}else{p=1260}do{if((p|0)==1260){S=Re(_|0,re|0)|0;if((S|0)==0){if(ne<<24>>24!=45){p=1263;break}if((n[I]|0)==0){u=-1}else{break}h=f;return u|0}T=n[S+1|0]|0;if(R&ne<<24>>24==87&T<<24>>24==59){do{if((n[I]|0)==0){M=(a[44]|0)+1|0;a[44]=M;if((M|0)<(e|0)){a[40]=a[t+(M<<2)>>2];break}a[40]=824;do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Fr(48,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=(n[_]|0)==58?58:63;h=f;return u|0}}while(0);M=Lr(t,_,i,o,0)|0;a[40]=824;u=M;h=f;return u|0}if(T<<24>>24!=58){if((n[I]|0)!=0){u=re;h=f;return u|0}a[44]=(a[44]|0)+1;u=re;h=f;return u|0}a[198]=0;do{if((n[I]|0)==0){if((n[S+2|0]|0)==58){break}M=(a[44]|0)+1|0;a[44]=M;if((M|0)<(e|0)){a[198]=a[t+(M<<2)>>2];break}a[40]=824;do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Fr(48,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=(n[_]|0)==58?58:63;h=f;return u|0}else{a[198]=I}}while(0);a[40]=824;a[44]=(a[44]|0)+1;u=re;h=f;return u|0}}while(0);do{if((p|0)==1263){if((n[I]|0)!=0){break}a[44]=(a[44]|0)+1}}while(0);do{if((a[46]|0)!=0){if((n[_]|0)==58){break}Fr(272,(E=h,h=h+8|0,a[E>>2]=re,E)|0)}}while(0);a[42]=re;u=63;h=f;return u|0}function Cr(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;return Br(e,t,r,n,i,1)|0}function Or(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;return Br(e,t,r,n,i,5)|0}function Nr(e){e=e|0;return mr(e)|0}function jr(e,t){e=e|0;t=t|0;return Nr(e)|0}function zr(){var e=0;e=Le(4)|0;a[e>>2]=560;_e(e|0,688,6)}function Lr(e,t,r,i,o){e=e|0;t=t|0;r=r|0;i=i|0;o=o|0;var s=0,f=0,u=0,c=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0;s=h;f=a[40]|0;u=a[44]|0;c=u+1|0;a[44]=c;l=Re(f|0,61)|0;if((l|0)==0){d=tn(f|0)|0;p=0}else{d=l-f|0;p=l+1|0}l=a[r>>2]|0;e:do{if((l|0)!=0){t:do{if((o|0)!=0&(d|0)==1){b=0;v=l;while(1){if((n[f]|0)==(n[v]|0)){if((tn(v|0)|0)==1){m=b;break t}}b=b+1|0;v=a[r+(b<<4)>>2]|0;if((v|0)==0){break e}}}else{v=0;b=-1;g=l;while(1){if((ge(f|0,g|0,d|0)|0)==0){if((tn(g|0)|0)==(d|0)){m=v;break t}if((b|0)==-1){y=v}else{break}}else{y=b}w=v+1|0;_=a[r+(w<<4)>>2]|0;if((_|0)==0){m=y;break t}else{v=w;b=y;g=_}}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Fr(304,(E=h,h=h+16|0,a[E>>2]=d,a[E+8>>2]=f,E)|0)}}while(0);a[42]=0;S=63;h=s;return S|0}}while(0);if((m|0)==-1){break}g=r+(m<<4)+4|0;b=a[g>>2]|0;v=(p|0)==0;if(!((b|0)!=0|v)){do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Fr(208,(E=h,h=h+16|0,a[E>>2]=d,a[E+8>>2]=f,E)|0)}}while(0);if((a[r+(m<<4)+8>>2]|0)==0){k=a[r+(m<<4)+12>>2]|0}else{k=0}a[42]=k;S=(n[t]|0)==58?58:63;h=s;return S|0}do{if((b-1|0)>>>0<2){if(!v){a[198]=p;break}if((b|0)!=1){break}a[44]=u+2;a[198]=a[e+(c<<2)>>2]}}while(0);if(!((a[g>>2]|0)==1&(a[198]|0)==0)){if((i|0)!=0){a[i>>2]=m}b=a[r+(m<<4)+8>>2]|0;v=a[r+(m<<4)+12>>2]|0;if((b|0)==0){S=v;h=s;return S|0}a[b>>2]=v;S=0;h=s;return S|0}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Fr(8,(E=h,h=h+8|0,a[E>>2]=f,E)|0)}}while(0);if((a[r+(m<<4)+8>>2]|0)==0){x=a[r+(m<<4)+12>>2]|0}else{x=0}a[42]=x;a[44]=(a[44]|0)-1;S=(n[t]|0)==58?58:63;h=s;return S|0}}while(0);if((o|0)!=0){a[44]=u;S=-1;h=s;return S|0}do{if((a[46]|0)!=0){if((n[t]|0)==58){break}Fr(248,(E=h,h=h+8|0,a[E>>2]=f,E)|0)}}while(0);a[42]=0;S=63;h=s;return S|0}function Hr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+16|0;n=r|0;i=n;a[i>>2]=t;a[i+4>>2]=0;Ur(e,n|0);h=r;return}function Fr(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;h=h+16|0;n=r|0;i=n;a[i>>2]=t;a[i+4>>2]=0;Dr(e,n|0);h=r;return}function Ur(e,t){e=e|0;t=t|0;var r=0,n=0,i=0;r=h;n=a[($e()|0)>>2]|0;i=a[w>>2]|0;xe(a[m>>2]|0,432,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;if((e|0)!=0){i=a[m>>2]|0;Ye(i|0,e|0,t|0)|0;t=a[m>>2]|0;Ce(472,2,1,t|0)|0}t=a[m>>2]|0;e=Se(n|0)|0;xe(t|0,384,(E=h,h=h+8|0,a[E>>2]=e,E)|0)|0;h=r;return}function Dr(e,t){e=e|0;t=t|0;var r=0,n=0;r=h;n=a[w>>2]|0;xe(a[m>>2]|0,376,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;if((e|0)!=0){n=a[m>>2]|0;Ye(n|0,e|0,t|0)|0}Pe(10,a[m>>2]|0)|0;h=r;return}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,o=0,s=0,f=0,u=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,j=0,z=0,L=0,H=0,F=0,U=0,D=0,q=0,K=0;r=e;while(1){i=r+1|0;if((He(n[r]|0)|0)==0){break}else{r=i}}o=n[r]|0;if((o<<24>>24|0)==45){s=i;f=1}else if((o<<24>>24|0)==43){s=i;f=0}else{s=r;f=0}r=-1;i=0;o=s;while(1){u=n[o]|0;if(((u<<24>>24)-48|0)>>>0<10){h=r}else{if(u<<24>>24!=46|(r|0)>-1){break}else{h=i}}r=h;i=i+1|0;o=o+1|0}h=o+(-i|0)|0;s=(r|0)<0;l=((s^1)<<31>>31)+i|0;d=(l|0)>18;p=(d?-18:-l|0)+(s?i:r)|0;r=d?18:l;do{if((r|0)==0){b=e;v=0}else{if((r|0)>9){l=h;d=r;i=0;while(1){s=n[l]|0;m=l+1|0;if(s<<24>>24==46){g=n[m]|0;y=l+2|0}else{g=s;y=m}w=(i*10|0)-48+(g<<24>>24)|0;m=d-1|0;if((m|0)>9){l=y;d=m;i=w}else{break}}_=+(w|0)*1e9;S=9;k=y;x=1393}else{if((r|0)>0){_=0;S=r;k=h;x=1393}else{A=0;M=0}}if((x|0)==1393){i=k;d=S;l=0;while(1){m=n[i]|0;s=i+1|0;if(m<<24>>24==46){E=n[s]|0;I=i+2|0}else{E=m;I=s}T=(l*10|0)-48+(E<<24>>24)|0;s=d-1|0;if((s|0)>0){i=I;d=s;l=T}else{break}}A=+(T|0);M=_}R=M+A;do{if((u<<24>>24|0)==69|(u<<24>>24|0)==101){l=o+1|0;d=n[l]|0;if((d<<24>>24|0)==43){P=o+2|0;B=0}else if((d<<24>>24|0)==45){P=o+2|0;B=1}else{P=l;B=0}l=n[P]|0;if(((l<<24>>24)-48|0)>>>0<10){C=P;O=0;N=l}else{j=0;z=P;L=B;break}while(1){l=(O*10|0)-48+(N<<24>>24)|0;d=C+1|0;i=n[d]|0;if(((i<<24>>24)-48|0)>>>0<10){C=d;O=l;N=i}else{j=l;z=d;L=B;break}}}else{j=0;z=o;L=0}}while(0);d=p+((L|0)==0?j:-j|0)|0;l=(d|0)<0?-d|0:d;if((l|0)>511){a[($e()|0)>>2]=34;H=1;F=88;U=511;x=1410}else{if((l|0)==0){D=1}else{H=1;F=88;U=l;x=1410}}if((x|0)==1410){while(1){x=0;if((U&1|0)==0){q=H}else{q=H*+c[F>>3]}l=U>>1;if((l|0)==0){D=q;break}else{H=q;F=F+8|0;U=l;x=1410}}}if((d|0)>-1){b=z;v=R*D;break}else{b=z;v=R/D;break}}}while(0);if((t|0)!=0){a[t>>2]=b}if((f|0)==0){K=v;return+K}K=-0-v;return+K}function Kr(e,t){e=e|0;t=t|0;return+ +qr(e,t)}function Yr(e,t){e=e|0;t=t|0;return+ +qr(e,t)}function Vr(e,t,r){e=e|0;t=t|0;r=r|0;return+ +qr(e,t)}function Wr(e,t,r){e=e|0;t=t|0;r=r|0;return+ +qr(e,t)}function Xr(e){e=e|0;return+ +qr(e,0)}function Zr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+16|0;i=n|0;n=i;a[n>>2]=r;a[n+4>>2]=0;Qr(e,t,i|0)}function Gr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=h;h=h+16|0;i=n|0;n=i;a[n>>2]=r;a[n+4>>2]=0;$r(e,t,i|0)}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,i=0;n=a[($e()|0)>>2]|0;i=a[w>>2]|0;xe(a[m>>2]|0,336,(E=h,h=h+8|0,a[E>>2]=i,E)|0)|0;if((t|0)!=0){i=a[m>>2]|0;Ye(i|0,t|0,r|0)|0;r=a[m>>2]|0;Ce(480,2,1,r|0)|0}r=a[m>>2]|0;t=Se(n|0)|0;xe(r|0,392,(E=h,h=h+8|0,a[E>>2]=t,E)|0)|0;je(e|0)}function $r(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;n=a[w>>2]|0;xe(a[m>>2]|0,440,(E=h,h=h+8|0,a[E>>2]=n,E)|0)|0;if((t|0)!=0){n=a[m>>2]|0;Ye(n|0,t|0,r|0)|0}Pe(10,a[m>>2]|0)|0;je(e|0)}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;i=e|0;if((e&3)==(t&3)){while(e&3){if((r|0)==0)return i|0;n[e]=n[t]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){a[e>>2]=a[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){n[e]=n[t]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function en(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,o=0,s=0;i=e+r|0;if((r|0)>=20){t=t&255;r=e&3;o=t|t<<8|t<<16|t<<24;s=i&~3;if(r){r=e+4-r|0;while((e|0)<(r|0)){n[e]=t;e=e+1|0}}while((e|0)<(s|0)){a[e>>2]=o;e=e+4|0}}while((e|0)<(i|0)){n[e]=t;e=e+1|0}}function tn(e){e=e|0;var t=0;t=e;while(n[t]|0){t=t+1|0}return t-e|0}function rn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=e+r>>>0;return(j=t+n+(i>>>0>>0|0)>>>0,i|0)|0}function nn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=t-n>>>0;i=t-n-(r>>>0>e>>>0|0)>>>0;return(j=i,e-r>>>0|0)|0}function an(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){j=t<>>32-r;return e<>>r;return e>>>r|(t&(1<>>r-32|0}function sn(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){j=t>>r;return e>>>r|(t&(1<>r-32|0}function fn(e){e=e|0;var t=0;t=n[v+(e>>>24)|0]|0;if((t|0)<8)return t|0;t=n[v+(e>>16&255)|0]|0;if((t|0)<8)return t+8|0;t=n[v+(e>>8&255)|0]|0;if((t|0)<8)return t+16|0;return(n[v+(e&255)|0]|0)+24|0}function un(e){e=e|0;var t=0;t=n[b+(e&255)|0]|0;if((t|0)<8)return t|0;t=n[b+(e>>8&255)|0]|0;if((t|0)<8)return t+8|0;t=n[b+(e>>16&255)|0]|0;if((t|0)<8)return t+16|0;return(n[b+(e>>>24)|0]|0)+24|0}function cn(e,t){e=e|0;t=t|0;var r=0,n=0,i=0,a=0;r=e&65535;n=t&65535;i=oe(n,r)|0;a=e>>>16;e=(i>>>16)+(oe(n,a)|0)|0;n=t>>>16;t=oe(n,r)|0;return(j=(e>>>16)+(oe(n,a)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|i&65535|0)|0}function hn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0,o=0,s=0,f=0;i=t>>31|((t|0)<0?-1:0)<<1;a=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=n>>31|((n|0)<0?-1:0)<<1;s=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;f=nn(i^e,a^t,i,a)|0;t=j;e=o^i;i=s^a;a=nn((vn(f,t,nn(o^r,s^n,o,s)|0,j,0)|0)^e,j^i,e,i)|0;return(j=j,a)|0}function ln(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0,s=0,f=0,u=0,c=0,l=0;i=h;h=h+8|0;o=i|0;s=t>>31|((t|0)<0?-1:0)<<1;f=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=n>>31|((n|0)<0?-1:0)<<1;c=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;l=nn(s^e,f^t,s,f)|0;t=j;e=nn(u^r,c^n,u,c)|0;vn(l,t,e,j,o)|0;e=nn(a[o>>2]^s,a[o+4>>2]^f,s,f)|0;f=j;h=i;return(j=f,e)|0}function dn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,a=0;i=e;e=r;r=cn(i,e)|0;a=j;return(j=(oe(t,e)|0)+(oe(n,i)|0)+a|a&0,r|0|0)|0}function pn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0;i=vn(e,t,r,n,0)|0;return(j=j,i)|0}function bn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var i=0,o=0;i=h;h=h+8|0;o=i|0;vn(e,t,r,n,o)|0;h=i;return(j=a[o+4>>2]|0,a[o>>2]|0)|0}function vn(e,t,r,n,i){e=e|0;t=t|0;r=r|0;n=n|0;i=i|0;var o=0,s=0,f=0,u=0,c=0,h=0,l=0,d=0,p=0,b=0,v=0,m=0,g=0,y=0,w=0,_=0,S=0,k=0,x=0,A=0,M=0,E=0,I=0,T=0,R=0,P=0,B=0,C=0,O=0,N=0,z=0,L=0;o=e;s=t;f=s;u=r;c=n;h=c;if((f|0)==0){l=(i|0)!=0;if((h|0)==0){if(l){a[i>>2]=(o>>>0)%(u>>>0);a[i+4>>2]=0}d=0;p=(o>>>0)/(u>>>0)>>>0;return(j=d,p)|0}else{if(!l){d=0;p=0;return(j=d,p)|0}a[i>>2]=e|0;a[i+4>>2]=t&0;d=0;p=0;return(j=d,p)|0}}l=(h|0)==0;do{if((u|0)==0){if(l){if((i|0)!=0){a[i>>2]=(f>>>0)%(u>>>0);a[i+4>>2]=0}d=0;p=(f>>>0)/(u>>>0)>>>0;return(j=d,p)|0}if((o|0)==0){if((i|0)!=0){a[i>>2]=0;a[i+4>>2]=(f>>>0)%(h>>>0)}d=0;p=(f>>>0)/(h>>>0)>>>0;return(j=d,p)|0}b=h-1|0;if((b&h|0)==0){if((i|0)!=0){a[i>>2]=e|0;a[i+4>>2]=b&f|t&0}d=0;p=f>>>((un(h|0)|0)>>>0);return(j=d,p)|0}b=(fn(h|0)|0)-(fn(f|0)|0)|0;if(b>>>0<=30){v=b+1|0;m=31-b|0;g=v;y=f<>>(v>>>0);w=f>>>(v>>>0);_=0;S=o<>2]=e|0;a[i+4>>2]=s|t&0;d=0;p=0;return(j=d,p)|0}else{if(!l){m=(fn(h|0)|0)-(fn(f|0)|0)|0;if(m>>>0<=31){v=m+1|0;b=31-m|0;k=m-31>>31;g=v;y=o>>>(v>>>0)&k|f<>>(v>>>0)&k;_=0;S=o<>2]=e|0;a[i+4>>2]=s|t&0;d=0;p=0;return(j=d,p)|0}b=u-1|0;if((b&u|0)!=0){k=(fn(u|0)|0)+33-(fn(f|0)|0)|0;v=64-k|0;m=32-k|0;x=m>>31;A=k-32|0;M=A>>31;g=k;y=m-1>>31&f>>>(A>>>0)|(f<>>(k>>>0))&M;w=M&f>>>(k>>>0);_=o<>>(A>>>0))&x|o<>31;break}if((i|0)!=0){a[i>>2]=b&o;a[i+4>>2]=0}if((u|0)==1){d=s|t&0;p=e|0|0;return(j=d,p)|0}else{b=un(u|0)|0;d=f>>>(b>>>0)|0;p=f<<32-b|o>>>(b>>>0)|0;return(j=d,p)|0}}}while(0);if((g|0)==0){E=S;I=_;T=w;R=y;P=0;B=0}else{o=r|0|0;r=c|n&0;n=rn(o,r,-1,-1)|0;c=j;f=S;S=_;_=w;w=y;y=g;g=0;while(1){C=S>>>31|f<<1;O=g|S<<1;u=w<<1|f>>>31|0;e=w>>>31|_<<1|0;nn(n,c,u,e)|0;t=j;s=t>>31|((t|0)<0?-1:0)<<1;N=s&1;z=nn(u,e,s&o,(((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1)&r)|0;L=j;t=y-1|0;if((t|0)==0){break}else{f=C;S=O;_=L;w=z;y=t;g=N}}E=C;I=O;T=L;R=z;P=0;B=N}N=I;I=0;if((i|0)!=0){a[i>>2]=R;a[i+4>>2]=T}d=(N|0)>>>31|(E|I)<<1|(I<<1|N>>>31)&0|P;p=(N<<1|0>>>31)&-2|B;return(j=d,p)|0}function mn(e,t){e=e|0;t=t|0;Tn[e&15](t|0)}function gn(e,t,r){e=e|0;t=t|0;r=r|0;Rn[e&15](t|0,r|0)}function yn(e,t){e=e|0;t=t|0;return Pn[e&7](t|0)|0}function wn(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;Bn[e&15](t|0,r|0,n|0)}function _n(e){e=e|0;Cn[e&1]()}function Sn(e,t,r){e=e|0;t=t|0;r=r|0;return On[e&1](t|0,r|0)|0}function kn(e){e=e|0;se(0)}function xn(e,t){e=e|0;t=t|0;se(1)}function An(e){e=e|0;se(2);return 0}function Mn(e,t,r){e=e|0;t=t|0;r=r|0;se(3)}function En(){se(4)}function In(e,t){e=e|0;t=t|0;se(5);return 0}var Tn=[kn,kn,xr,kn,Rr,kn,yr,kn,kr,kn,Tr,kn,kn,kn,kn,kn];var Rn=[xn,xn,Hr,xn,Ur,xn,Fr,xn,Dr,xn,xn,xn,xn,xn,xn,xn];var Pn=[An,An,wr,An,_r,An,An,An];var Bn=[Mn,Mn,$r,Mn,Qr,Mn,Zr,Mn,Gr,Mn,Mn,Mn,Mn,Mn,Mn,Mn];var Cn=[En,En];var On=[In,In];return{_crypto_scrypt:Et,_strlen:tn,_free:Yt,_realloc:Wt,_memset:en,_malloc:Kt,_memcpy:Jr,_calloc:Vt,runPostSets:wt,stackAlloc:it,stackSave:at,stackRestore:ot,setThrew:st,setTempRet0:ct,setTempRet1:ht,setTempRet2:lt,setTempRet3:dt,setTempRet4:pt,setTempRet5:bt,setTempRet6:vt,setTempRet7:mt,setTempRet8:gt,setTempRet9:yt,dynCall_vi:mn,dynCall_vii:gn,dynCall_ii:yn,dynCall_viii:wn,dynCall_v:_n,dynCall_iii:Sn}}({Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},{abort:wa,assert:w,asmPrintInt:function(e,t){s.print("int "+e+","+t)},asmPrintFloat:function(e,t){s.print("float "+e+","+t)},min:Xc,invoke_vi:function(e,t){try{s.dynCall_vi(e,t)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_vii:function(e,t,r){try{s.dynCall_vii(e,t,r)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_ii:function(e,t){try{return s.dynCall_ii(e,t)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_viii:function(e,t,r,n){try{s.dynCall_viii(e,t,r,n)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_v:function(e){try{s.dynCall_v(e)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},invoke_iii:function(e,t,r){try{return s.dynCall_iii(e,t,r)}catch(e){"number"!=typeof e&&"longjmp"!==e&&g(e),V.setThrew(1,0)}},_strncmp:function(e,t,r){for(var n=0;na?1:-1;n++}return 0},_llvm_va_end:aa(),_sysconf:function(e){switch(e){case 8:return 4096;case 54:case 56:case 21:case 61:case 63:case 22:case 67:case 23:case 24:case 25:case 26:case 27:case 69:case 28:case 101:case 70:case 71:case 29:case 30:case 199:case 75:case 76:case 32:case 43:case 44:case 80:case 46:case 47:case 45:case 48:case 49:case 42:case 82:case 33:case 7:case 108:case 109:case 107:case 112:case 119:case 121:return 200809;case 13:case 104:case 94:case 95:case 34:case 35:case 77:case 81:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 94:case 95:case 110:case 111:case 113:case 114:case 115:case 116:case 117:case 118:case 120:case 40:case 16:case 79:case 19:return-1;case 92:case 93:case 5:case 72:case 6:case 74:case 92:case 93:case 96:case 97:case 98:case 99:case 102:case 103:case 105:return 1;case 38:case 66:case 50:case 51:case 4:return 1024;case 15:case 64:case 41:return 32;case 55:case 37:case 17:return 2147483647;case 18:case 1:return 47839;case 59:case 57:return 99;case 68:case 58:return 2048;case 0:return 2097152;case 3:return 65536;case 14:return 32768;case 73:return 32767;case 39:return 16384;case 60:return 1e3;case 106:return 700;case 52:return 256;case 62:return 255;case 2:return 100;case 65:return 64;case 36:return 20;case 100:return 16;case 20:return 6;case 53:return 4;case 10:return 1}return M(N.A),-1},___cxa_throw:rc,_strerror:zc,_abort:function(){s.abort()},_fprintf:mc,_llvm_eh_exception:U,___cxa_free_exception:sc,_fflush:aa(),___buildEnvironment:wc,__reallyNegative:jc,_strchr:function(e,t){e--;do{e++;var r=A[e];if(r==t)return e}while(r);return 0},_fputc:Bc,___setErrNo:M,_fwrite:hc,_send:fc,_write:gc,_exit:function(e){Ac(e)},___cxa_find_matching_catch:function(e,t){-1==e&&(e=B[U.m>>2]),-1==t&&(t=B[U.m+4>>2]);var r=Array.prototype.slice.call(arguments,2);0!=t&&!pc(t)&&0==B[B[t>>2]-8>>2]&&(e=B[e>>2]);for(var n=0;n=e},__formatString:kc,___resumeException:function(e){0==B[U.m>>2]&&(B[U.m>>2]=e),g(e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.")},_llvm_uadd_with_overflow_i32:function(e,t){return e>>>=0,t>>>=0,0|(V.setTempRet0(4294967295>>0)},___cxa_does_inherit:qc,_getenv:xc,_vfprintf:function(e,t,r){return mc(e,t,B[r>>2])},___cxa_begin_catch:function(e){return oc.ta--,e},__ZSt18uncaught_exceptionv:oc,_pwrite:function(e,t,r,n){if(!(e=R[e]))return M(N.$),-1;try{return Ib(e,A,t,r,n)}catch(e){return Zb(e),-1}},___cxa_call_unexpected:function(e){s.P("Unexpected exception thrown, this is not properly supported - aborting"),za=l,g(e)},_sbrk:nc,_strerror_r:yc,___errno_location:function(){return rb},___gxx_personality_v0:aa(),___cxa_is_number_type:pc,_time:function(e){var t=Math.floor(Date.now()/1e3);return e&&(B[e>>2]=t),t},__exit:Ac,___cxa_end_catch:uc,STACKTOP:u,STACK_MAX:Ta,tempDoublePtr:qb,ABORT:za,cttz_i8:Wc,ctlz_i8:Vc,NaN:NaN,Infinity:1/0,_stderr:nb,__ZTVN10__cxxabiv120__si_class_type_infoE:ob,__ZTVN10__cxxabiv117__class_type_infoE:pb,___progname:k},I);s._crypto_scrypt=V._crypto_scrypt;var ic=s._strlen=V._strlen,tc=s._free=V._free;s._realloc=V._realloc;var tb=s._memset=V._memset,Oa=s._malloc=V._malloc,sb=s._memcpy=V._memcpy;s._calloc=V._calloc;var mb=s.runPostSets=V.runPostSets;s.dynCall_vi=V.dynCall_vi,s.dynCall_vii=V.dynCall_vii,s.dynCall_ii=V.dynCall_ii,s.dynCall_viii=V.dynCall_viii,s.dynCall_v=V.dynCall_v,s.dynCall_iii=V.dynCall_iii;var qa=function(e){return V.stackAlloc(e)},ja=function(){return V.stackSave()},ka=function(e){V.stackRestore(e)},lc;Y.Ca={},Y.D=function(e){if(-128<=e&&128>e){var t=Y.Ca[e];if(t)return t}return t=new Y(0|e,0>e?-1:0),-128<=e&&128>e&&(Y.Ca[e]=t),t},Y.p=function(e){return isNaN(e)||!isFinite(e)?Y.ZERO:e<=-Y.Ea?Y.MIN_VALUE:e+1>=Y.Ea?Y.MAX_VALUE:0>e?Y.p(-e).i():new Y(e%Y.B|0,e/Y.B|0)},Y.v=function(e,t){return new Y(e,t)},Y.k=function(e,t){0==e.length&&g(Error("number format error: empty string"));var r=t||10;if((2>r||36o?(o=Y.p(Math.pow(r,o)),i=i.multiply(o).add(Y.p(s))):(i=i.multiply(n),i=i.add(Y.p(s)))}return i},Y.ea=65536,Y.Od=16777216,Y.B=Y.ea*Y.ea,Y.Pd=Y.B/2,Y.Qd=Y.B*Y.ea,Y.eb=Y.B*Y.B,Y.Ea=Y.eb/2,Y.ZERO=Y.D(0),Y.ONE=Y.D(1),Y.Da=Y.D(-1),Y.MAX_VALUE=Y.v(-1,2147483647),Y.MIN_VALUE=Y.v(0,-2147483648),Y.cb=Y.D(16777216),q=Y.prototype,q.Z=function(){return this.j*Y.B+this.ob()},q.toString=function(e){if(e=e||10,(2>e||36a.length;)a="0"+a;n=""+a+n}},q.ob=function(){return 0<=this.h?this.h:Y.B+this.h},q.G=function(){return 0==this.j&&0==this.h},q.n=function(){return 0>this.j},q.Pa=function(){return 1==(1&this.h)},q.o=function(e){return this.j==e.j&&this.h==e.h},q.Ra=function(){return 0>this.ja(Y.cb)},q.qb=function(e){return 0>>16,n=65535&this.j,i=this.h>>>16,a=e.j>>>16,o=65535&e.j,s=e.h>>>16;return t=(65535&this.h)+(65535&e.h)+0,e=0+(t>>>16),e+=i+s,i=0+(e>>>16),i+=n+o,n=0+(i>>>16),n=n+(r+a)&65535,Y.v((65535&e)<<16|65535&t,n<<16|65535&i)},q.R=function(e){return this.add(e.i())},q.multiply=function(e){if(this.G()||e.G())return Y.ZERO;if(this.o(Y.MIN_VALUE))return e.Pa()?Y.MIN_VALUE:Y.ZERO;if(e.o(Y.MIN_VALUE))return this.Pa()?Y.MIN_VALUE:Y.ZERO;if(this.n())return e.n()?this.i().multiply(e.i()):this.i().multiply(e).i();if(e.n())return this.multiply(e.i()).i();if(this.Ra()&&e.Ra())return Y.p(this.Z()*e.Z());var t,r,n,i,a=this.j>>>16,o=65535&this.j,s=this.h>>>16,f=65535&this.h,u=e.j>>>16,c=65535&e.j,h=e.h>>>16,e=65535&e.h;return i=0+f*e,n=0+(i>>>16),n+=s*e,r=0+(n>>>16),n=(65535&n)+f*h,r+=n>>>16,n&=65535,r+=o*e,t=0+(r>>>16),r=(65535&r)+s*h,t+=r>>>16,r&=65535,r+=f*c,t+=r>>>16,r&=65535,t=t+(a*e+o*h+s*c+f*u)&65535,Y.v(n<<16|65535&i,t<<16|r)},q.F=function(e){if(e.G()&&g(Error("division by zero")),this.G())return Y.ZERO;if(this.o(Y.MIN_VALUE)){if(e.o(Y.ONE)||e.o(Y.Da))return Y.MIN_VALUE;if(e.o(Y.MIN_VALUE))return Y.ONE;var t=this.Db().F(e).shiftLeft(1);if(t.o(Y.ZERO))return e.n()?Y.ONE:Y.Da;var r=this.R(e.multiply(t));return t.add(r.F(e))}if(e.o(Y.MIN_VALUE))return Y.ZERO;if(this.n())return e.n()?this.i().F(e.i()):this.i().F(e).i();if(e.n())return this.F(e.i()).i();for(var n=Y.ZERO,r=this;r.rb(e);){for(var t=Math.max(1,Math.floor(r.Z()/e.Z())),i=Math.ceil(Math.log(t)/Math.LN2),i=48>=i?1:Math.pow(2,i-48),a=Y.p(t),o=a.multiply(e);o.n()||o.qb(r);)t-=i,a=Y.p(t),o=a.multiply(e);a.G()&&(a=Y.ONE),n=n.add(a),r=r.R(o)}return n},q.xb=function(){return Y.v(~this.h,~this.j)},q.shiftLeft=function(e){if(0==(e&=63))return this;var t=this.h;return 32>e?Y.v(t<>>32-e):Y.v(0,t<e?Y.v(this.h>>>e|t<<32-e,t>>e):Y.v(t>>e-32,0<=t?0:-1)},q=X.prototype,q.ga=function(e,t,r,n){for(var i=0,a=0;0<=--n;){var o=e*this[i++]+t[r]+a,a=Math.floor(o/67108864);t[r++]=67108863&o}return a},q.f=26,q.u=67108863,q.K=67108864,q.bb=Math.pow(2,52),q.Aa=26,q.Ba=0;var $c=[],bd,Z;for(bd=48,Z=0;9>=Z;++Z)$c[bd++]=Z;for(bd=97,Z=10;36>Z;++Z)$c[bd++]=Z;for(bd=65,Z=10;36>Z;++Z)$c[bd++]=Z;q=X.prototype,q.copyTo=function(e){for(var t=this.b-1;0<=t;--t)e[t]=this[t];e.b=this.b,e.c=this.c},q.D=function(e){this.b=1,this.c=0>e?-1:0,0e?this[0]=e+DV:this.b=0},q.k=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.nb(e,t);r=2}this.c=this.b=0;for(var n=e.length,i=p,a=0;0<=--n;){var o=8==r?255&e[n]:Zc(e,n);0>o?"-"==e.charAt(n)&&(i=l):(i=p,0==a?this[this.b++]=o:a+r>this.f?(this[this.b-1]|=(o&(1<>this.f-a):this[this.b-1]|=o<=this.f&&(a-=this.f))}8==r&&0!=(128&e[0])&&(this.c=-1,0>i|s,s=(this[r]&a)<=this.b)t.b=0;else{var n=e%this.f,i=this.f-n,a=(1<>n;for(var o=r+1;o>n;0>=this.f;if(e.b>=this.f;n+=this.c}else{for(n+=this.c;r>=this.f;n-=e.c}t.c=0>n?-1:0,-1>n?t[r++]=this.K+n:0=n.b)){var i=this.abs();if(i.b>>16)&&(f=a,u+=16),0!=(a=f>>8)&&(f=a,u+=8),0!=(a=f>>4)&&(f=a,u+=4),0!=(a=f>>2)&&(f=a,u+=2),0!=f>>1&&(u+=1),f=this.f-u,0>this.Ba:0),u=this.bb/a,a=(1<s&&X.ZERO.t(r,r)}}}},q.toString=function(e){if(0>this.c)return"-"+this.i().toString(e);if(16==e)e=4;else if(8==e)e=3;else if(2==e)e=1;else if(32==e)e=5;else{if(4!=e)return this.Fb(e);e=2}var t,r=(1<>o)&&(n=l,i="0123456789abcdefghijklmnopqrstuvwxyz".charAt(t));0<=a;)o>(o+=this.f-e)):(t=this[a]>>(o-=e)&r,0>=o&&(o+=this.f,--a)),0this.c?this.i():this},q.U=function(e){var t=this.c-e.c;if(0!=t)return t;var r=this.b,t=r-e.b;if(0!=t)return 0>this.c?-t:t;for(;0<=--r;)if(0!=(t=this[r]-e[r]))return t;return 0},X.ZERO=ad(0),X.ONE=ad(1),q=X.prototype,q.nb=function(e,t){this.D(0),t==m&&(t=10);for(var r=this.S(t),n=Math.pow(t,r),i=p,a=0,o=0,s=0;sf?"-"==e.charAt(s)&&0==this.ra()&&(i=l):(o=t*o+f,++a>=r&&(this.Ia(n),this.Ha(o),o=a=0))}0this.c?-1:0>=this.b||1==this.b&&0>=this[0]?0:1},q.Ia=function(e){this[this.b]=this.ga(e-1,this,0,this.b),++this.b,this.C()},q.Ha=function(e){var t=0;if(0!=e){for(;this.b<=t;)this[this.b++]=0;for(this[t]+=e;this[t]>=this.K;)this[t]-=this.K,++t>=this.b&&(this[this.b++]=0),++this[t]}},q.Fb=function(e){if(e==m&&(e=10),0==this.ra()||2>e||36this.c){if(1==this.b)return this[0]-this.K;if(0==this.b)return-1}else{if(1==this.b)return this[0];if(0==this.b)return 0}return(this[1]&(1<<32-this.f)-1)<>=this.f;if(e.b>=this.f;n+=this.c}else{for(n+=this.c;r>=this.f;n+=e.c}t.c=0>n?-1:0,0n&&(t[r++]=this.K+n),t.b=r,t.C()};var $={abs:function(e,t){var r=new Y(e,t),r=r.n()?r.i():r;B[qb>>2]=r.h,B[qb+4>>2]=r.j},Ka:function(){$.kb||($.kb=l,$.Xa=new X,$.Xa.k("4294967296",10),$.sa=new X,$.sa.k("18446744073709551616",10),$.xe=new X,$.ye=new X)},me:function(e,t){var r=new X;r.k(t.toString(),10);var n=new X;r.vb(n),r=new X,r.k(e.toString(),10);var i=new X;return r.fa(n,i),i},stringify:function(e,t,r){return e=new Y(e,t).toString(),r&&"-"==e[0]&&($.Ka(),r=new X,r.k(e,10),e=new X,$.sa.fa(r,e),e=e.toString(10)),e},k:function(e,t,r,n,i){$.Ka();var a=new X;a.k(e,t),e=new X,e.k(r,10),r=new X,r.k(n,10),i&&0>a.U(X.ZERO)&&(n=new X,a.fa($.sa,n),a=n),n=p,0>a.U(e)?(a=e,n=l):0>2]=a.h,B[qb+4>>2]=a.j,n&&g("range error")}};lc=$;var cd,dd;if(s.callMain=s.$d=function(e){function t(){for(var e=0;3>e;e++)n.push(0)}w(0==L,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),w(0==Wa.length,"cannot call main when preRun functions remain to be called"),e=e||[],ab||(ab=l,Va(Xa));var r=e.length+1,n=[F(J("/bin/this.program"),"i8",Ka)];t();for(var i=0;i>4&15]),t.push("0123456789abcdef"[15&e[r]]);return t.join("")}function a(e,t){var r=t||0,n=scrypt_raw._malloc(e.length+r);scrypt_raw.HEAPU8.set(e,n+r);for(var i=n;i=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),a=n(r.split("/")),o=Math.min(i.length,a.length),s=o,f=0;f=64;){var d,p,b,v,m,g=n,y=i,w=a,_=o,S=s,k=f,x=u,A=c;for(p=0;p<16;p++)b=t+4*p,h[p]=(255&e[b])<<24|(255&e[b+1])<<16|(255&e[b+2])<<8|255&e[b+3];for(p=16;p<64;p++)d=h[p-2],v=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=h[p-15],m=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,h[p]=(v+h[p-7]|0)+(m+h[p-16]|0)|0;for(p=0;p<64;p++)v=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&k^~S&x)|0)+(A+(r[p]+h[p]|0)|0)|0,m=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&y^g&w^y&w)|0,A=x,x=k,k=S,S=_+v|0,_=w,w=y,y=g,g=v+m|0;n=n+g|0,i=i+y|0,a=a+w|0,o=o+_|0,s=s+S|0,f=f+k|0,u=u+x|0,c=c+A|0,t+=64,l-=64}}var r=[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],n=1779033703,i=3144134277,a=1013904242,o=2773480762,s=1359893119,f=2600822924,u=528734635,c=1541459225,h=new Array(64);t(e);var l,d=e.length%64,p=e.length/536870912|0,b=e.length<<3,v=d<56?56:120,m=e.slice(e.length-d,e.length);for(m.push(128),l=d+1;l>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),m.push(b>>>24&255),m.push(b>>>16&255),m.push(b>>>8&255),m.push(b>>>0&255),t(m),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>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,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(e,t,r){function i(){for(var e=o-1;e>=o-4;e--){if(++s[e]<=255)return;s[e]=0}}e=e.length<=64?e:n(e);var a,o=64+t.length+4,s=new Array(o),f=new Array(64),u=[];for(a=0;a<64;a++)s[a]=54;for(a=0;a=32;)i(),u=u.concat(n(f.concat(n(s)))),r-=32;return r>0&&(i(),u=u.concat(n(f.concat(n(s))).slice(0,r))),u}function a(e,t,r,n,i){var a;for(u(e,16*(2*r-1),i,0,16),a=0;a<2*r;a++)f(e,16*a,i,16),s(i,n),u(i,0,e,t+16*a,16);for(a=0;a>>32-t}function s(e,t){u(e,0,t,0,16);for(var r=8;r>0;r-=2)t[4]^=o(t[0]+t[12],7),t[8]^=o(t[4]+t[0],9),t[12]^=o(t[8]+t[4],13),t[0]^=o(t[12]+t[8],18),t[9]^=o(t[5]+t[1],7),t[13]^=o(t[9]+t[5],9),t[1]^=o(t[13]+t[9],13),t[5]^=o(t[1]+t[13],18),t[14]^=o(t[10]+t[6],7),t[2]^=o(t[14]+t[10],9),t[6]^=o(t[2]+t[14],13),t[10]^=o(t[6]+t[2],18),t[3]^=o(t[15]+t[11],7),t[7]^=o(t[3]+t[15],9),t[11]^=o(t[7]+t[3],13),t[15]^=o(t[11]+t[7],18),t[1]^=o(t[0]+t[3],7),t[2]^=o(t[1]+t[0],9),t[3]^=o(t[2]+t[1],13),t[0]^=o(t[3]+t[2],18),t[6]^=o(t[5]+t[4],7),t[7]^=o(t[6]+t[5],9),t[4]^=o(t[7]+t[6],13),t[5]^=o(t[4]+t[7],18),t[11]^=o(t[10]+t[9],7),t[8]^=o(t[11]+t[10],9),t[9]^=o(t[8]+t[11],13),t[10]^=o(t[9]+t[8],18),t[12]^=o(t[15]+t[14],7),t[13]^=o(t[12]+t[15],9),t[14]^=o(t[13]+t[12],13),t[15]^=o(t[14]+t[13],18);for(r=0;r<16;++r)e[r]+=t[r]}function f(e,t,r,n){for(var i=0;i=256)return!1}return!0}function h(e,t){var r=parseInt(e);if(e!=r)throw new Error("invalid "+t);return r}function l(e,r,n,o,s,l,p){if(!p)throw new Error("missing callback");if(n=h(n,"N"),o=h(o,"r"),s=h(s,"p"),l=h(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>d/128/o)throw new Error("N too large");if(o>d/128/s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(!c(r))throw new Error("salt must be an array or buffer");for(var b=i(e,r,128*s*o),v=new Uint32Array(32*s*o),m=0;mB&&(t=B);for(var r=0;rB&&(t=B);for(var r=0;r>0&255),b.push(v[r]>>8&255),b.push(v[r]>>16&255),b.push(v[r]>>24&255);var m=i(e,b,l);return p(null,1,m)}C(O)};O()}var d=2147483647;e.exports=l}()}).call(t,r(34).setImmediate)},function(e,t,r){var n,i;!function(a,o){"use strict";n=o,void 0!==(i="function"==typeof n?n.call(t,r,t,e):n)&&(e.exports=i)}(0,function(){"use strict";function e(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function t(t){return"debug"===t&&(t="log"),typeof console!==s&&(void 0!==console[t]?e(console,t):void 0!==console.log?e(console,"log"):o)}function r(e,t){for(var r=0;r=0&&t<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(u=t,!1!==n&&a(t),r.call(c,t,e),typeof console===s&&t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=r.address||"",this.net=r.net||"NoNet",this.assetSymbols=r.assetSymbols?r.assetSymbols:[],this.assets={},r.assets&&Object.keys(r.assets).map(function(e){"object"===i(r.assets[e])&&t.addAsset(e,r.assets[e])}),this.tokenSymbols=r.tokenSymbols?r.tokenSymbols:[],this.tokens=r.tokens?r.tokens:{}}return a(e,[{key:"addAsset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,o.AssetBalance)();e=e.toUpperCase(),this.assetSymbols.push(e);var r=(0,o.AssetBalance)(t);return this.assets[e]=r,this}},{key:"addToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e=e.toUpperCase(),this.tokenSymbols.push(e),this.tokens[e]=new u.Fixed8(t),this}},{key:"applyTx",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=e instanceof s.Transaction?e:s.Transaction.deserialize(e);var n=this.assetSymbols,i=!0,a=!1,o=void 0;try{for(var u,c=e.inputs[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;!function(e){var r=function(t){return t.txid===e.prevHash&&t.index===e.prevIndex},i=!0,a=!1,o=void 0;try{for(var s,f=n[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var u=s.value,c=t.assets[u],h=c.unspent.findIndex(r);if(h>=0){var l=c.unspent.splice(h,1);c.spent=c.spent.concat(l);break}}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}}(h)}}catch(e){a=!0,o=e}finally{try{!i&&c.return&&c.return()}finally{if(a)throw o}}for(var l=e.hash,d=0;d=0&&o.unconfirmed.splice(u,1),o.balance=o.balance.add(i.value),o.unspent||(o.unspent=[]),o.unspent.push(s)}else o.unconfirmed||(o.unconfirmed=[]),o.unconfirmed.push(s);t.assets[a]=o}(d);return this}},{key:"confirm",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.assetSymbols[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){var a=n.value,o=this.assets[a];o.unspent=o.unspent.concat(o.unconfirmed),o.unconfirmed=[]}}catch(e){t=!0,r=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw r}}return this}},{key:"export",value:function(){return{net:this.net,address:this.address,assetSymbols:this.assetSymbols,assets:p(this.assets),tokenSymbols:this.tokenSymbols,tokens:this.tokens}}},{key:"verifyAssets",value:function(e){var t=this,r=[],n=this.assetSymbols;return n.map(function(n){var i=t.assets[n];r.push(l(e,i))}),Promise.all(r).then(function(e){return n.map(function(r,n){t.assets[r]=e[n]}),t})}},{key:Symbol.toStringTag,get:function(){return"Balance"}}],[{key:"import",value:function(t){return new e(JSON.parse(t))}}]),e}(),l=function(e,t){var r={balance:new u.Fixed8(0),spent:[],unspent:[],unconfirmed:[]};return d(e,t.unspent).then(function(e){return e.map(function(e,n){var i=t.unspent[n];e?(0!==e.value.cmp(i.value)&&(i.value=e.value),r.unspent.push(i),r.balance=r.balance.add(i.value)):r.spent.push(i)}),r})},d=function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var f=o.value;!function(t){var n=c.Query.getTxOut(t.txid,t.index).execute(e).then(function(e){var r=e.result;return r?{txid:t.txid,index:r.n,assetId:r.asset,value:new u.Fixed8(r.value)}:null});r.push(n)}(f)}}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return Promise.all(r)};t.default=h;var p=function(e){var t={};return Object.keys(e).map(function(r){var n=e[r],i={balance:n.balance.toNumber(),spent:n.spent.map(function(e){return b(e)}),unspent:n.unspent.map(function(e){return b(e)}),unconfirmed:n.unconfirmed.map(function(e){return b(e)})};t[r]=i}),t},b=function(e){return{index:e.index,txid:e.txid,value:e.value.toNumber()}}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.type=r.type||128,this.version=r.version||u.TX_VERSION.CONTRACT,this.attributes=r.attributes||[],this.inputs=r.inputs||[],this.outputs=r.outputs?r.outputs.map(function(e){return b.TransactionOutput(e)}):[],this.scripts=r.scripts||[];var n=y.getExclusive[this.type](r);Object.keys(n).map(function(e){t[e]=n[e]})}return s(e,[{key:"addOutput",value:function(e,t,r){if(3===arguments.length)this.outputs.push(b.createTransactionOutput(e,t,r));else{if("object"!==o(arguments[0]))throw new Error("Invalid input given! Give either 1 or 3 arguments!");this.outputs.push(arguments[0])}return this}},{key:"addAttribute",value:function(e,t){if("string"!=typeof t)throw new TypeError("data should be formatted as string!");return this.attributes.push({usage:e,data:t}),this}},{key:"addRemark",value:function(e){var t=(0,h.str2hexstring)(e);return this.addAttribute(d.default.Remark,t)}},{key:"calculate",value:function(e){var t=m.calculateInputs(e,this.outputs,this.gas),r=t.inputs,n=t.change;return this.inputs=r,this.outputs=this.outputs.concat(n),e.applyTx(this),S.info("Calculated the inputs required for Transaction with Balance: "+e.address),this}},{key:"serialize",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return m.serializeTransaction(this,e)}},{key:"serializeExclusiveData",value:function(){return y.serializeExclusive[this.type](this)}},{key:"sign",value:function(e){return"string"==typeof e&&(e=new f.Account(e)),m.signTransaction(this,e.privateKey),S.info("Signed Transaction with Account: "+e.label),this}},{key:Symbol.toStringTag,get:function(){return"Transaction"}},{key:"exclusiveData",get:function(){return y.getExclusive[this.type](this)}},{key:"hash",get:function(){return m.getTransactionHash(this)}}],[{key:"createClaimTx",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.claims.length)throw new Error("Useless transaction! There is no claims!");var i=new f.Account(t),a=Object.assign({type:2,version:u.TX_VERSION.CLAIM},n),o=new h.Fixed8(0);a.claims=r.claims.slice(0,255).map(function(e){return o=o.add(e.claim),{prevHash:e.txid,prevIndex:e.index}}),a.outputs=[{assetId:u.ASSET_ID.GAS,value:o,scriptHash:i.scriptHash}];var s=new e(Object.assign(a,n));return S.info("New ClaimTransaction for "+i.address),s}},{key:"createContractTx",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===r)throw new Error("Useless transaction! You are not sending anything!");var i=Object.assign({type:128,version:u.TX_VERSION.CONTRACT,outputs:r},n),a=new e(i).calculate(t);return S.info("New ContractTransaction for "+t.address),a}},{key:"createInvocationTx",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};null===r&&(r=[]);var o=Object.assign({type:209,version:u.TX_VERSION.INVOCATION,outputs:r,script:"string"==typeof n?n:(0,c.createScript)(n),gas:i},a),s=new e(o).calculate(t);return S.info("New InvocationTransaction for "+t.address),s}},{key:"deserialize",value:function(t){var r=m.deserializeTransaction(t),n=y.getExclusive[r.type](r);return new e(Object.assign(r,n))}}]),e}();t.default=k},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=void 0;var n=r(2),i=r(69),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.createScript=function(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:h.RPC_VERSION;if(i(this,e),t===h.NEO_NETWORK.MAIN?this.net=h.DEFAULT_RPC.MAIN:t===h.NEO_NETWORK.TEST?this.net=h.DEFAULT_RPC.TEST:this.net=t,this.history=[],this.version="",!c.default.valid(r))throw new Error("Invalid Version: "+r);this.version=c.default.clean(r)}return a(e,[{key:"execute",value:function(e){return this.history.push(e),p.info("RPC: "+this.net+" executing Query["+e.req.method+"]"),e.execute(this.net)}},{key:"query",value:function(e){var t=new s.default(e);return this.execute(t)}},{key:"getAccountState",value:function(e){if(!(0,f.isAddress)(e))throw new Error("Invalid address given: "+e);return this.execute(s.default.getAccountState(e)).then(function(e){return e.result})}},{key:"getAssetState",value:function(e){return this.execute(s.default.getAssetState(e)).then(function(e){return e.result})}},{key:"getBlock",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.execute(s.default.getBlock(e,t)).then(function(e){return e.result})}},{key:"getBlockHash",value:function(e){return this.execute(s.default.getBlockHash(e)).then(function(e){return e.result})}},{key:"getBestBlockHash",value:function(){return this.execute(s.default.getBestBlockHash()).then(function(e){return e.result})}},{key:"getBlockCount",value:function(){return this.execute(s.default.getBlockCount()).then(function(e){return e.result})}},{key:"getBlockSysFee",value:function(e){return this.execute(s.default.getBlockSysFee(e)).then(function(e){return e.result})}},{key:"getConnectionCount",value:function(){return this.execute(s.default.getConnectionCount()).then(function(e){return e.result})}},{key:"getContractState",value:function(e){return this.execute(s.default.getContractState(e)).then(function(e){return e.result})}},{key:"getPeers",value:function(){return this.execute(s.default.getPeers()).then(function(e){return e.result})}},{key:"getRawMemPool",value:function(){return this.execute(s.default.getRawMemPool()).then(function(e){return e.result})}},{key:"getRawTransaction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.execute(s.default.getRawTransaction(e,t)).then(function(e){return e.result})}},{key:"getStorage",value:function(e,t){return this.execute(s.default.getStorage(e,t)).then(function(e){return e.result})}},{key:"getTxOut",value:function(e,t){return this.execute(s.default.getTxOut(e,t)).then(function(e){return e.result})}},{key:"getVersion",value:function(){var e=this;return this.execute(s.default.getVersion()).then(function(t){var r=t.result.useragent.match(b)[1];return e.version=c.default.clean(r),e.version}).catch(function(t){if(t.message.includes("Method not found"))return e.version=h.RPC_VERSION,e.version;throw t})}},{key:"invoke",value:function(e,t){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invoke(e,t)).then(function(e){return e.result})}},{key:"invokeFunction",value:function(e,t,r){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invokeFunction(e,t,r)).then(function(e){return e.result})}},{key:"invokeScript",value:function(e){return c.default.lt(this.version,"2.3.3")?Promise.reject(new Error("This method is not implemented for this version")):this.execute(s.default.invokeScript(e)).then(function(e){return e.result})}},{key:"sendRawTransaction",value:function(e){return this.execute(s.default.sendRawTransaction(e)).then(function(e){return e.result})}},{key:"submitBlock",value:function(e){return this.execute(s.default.submitBlock(e)).then(function(e){return e.result})}},{key:"validateAddress",value:function(e){return this.execute(s.default.validateAddress(e)).then(function(e){return e.result.isvalid})}},{key:Symbol.toStringTag,get:function(){return"RPC Client"}}]),e}();t.default=v},function(e,t,r){"use strict";function n(e){var t=new o(e),r=a(o.prototype.request,t);return i.extend(r,o.prototype,t),i.extend(r,t),r}var i=r(9),a=r(73),o=r(179),s=r(46),f=n(s);f.Axios=o,f.create=function(e){return n(i.merge(s,e))},f.Cancel=r(77),f.CancelToken=r(193),f.isCancel=r(76),f.all=function(e){return Promise.all(e)},f.spread=r(194),e.exports=f,e.exports.default=f},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function n(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},function(e,t,r){"use strict";function n(e){this.defaults=e,this.interceptors={request:new o,response:new o}}var i=r(46),a=r(9),o=r(187),s=r(188);n.prototype.request=function(e){"string"==typeof e&&(e=a.merge({url:arguments[0]},arguments[1])),e=a.merge(i,this.defaults,{method:"get"},e),e.method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},a.forEach(["delete","get","head","options"],function(e){n.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))}}),a.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=n},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(75);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e}},function(e,t,r){"use strict";function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=r(9);e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(i.isURLSearchParams(t))a=t.toString();else{var o=[];i.forEach(t,function(e,t){null!==e&&void 0!==e&&(i.isArray(e)&&(t+="[]"),i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),o.push(n(t)+"="+n(e))}))}),a=o.join("&")}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e}},function(e,t,r){"use strict";var n=r(9),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}}),o):o}},function(e,t,r){"use strict";var n=r(9);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(r){var i=n.isString(r)?e(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";function n(){this.message="String contains an invalid character"}function i(e){for(var t,r,i=String(e),o="",s=0,f=a;i.charAt(0|s)||(f="=",s%1);o+=f.charAt(63&t>>8-s%1*8)){if((r=i.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return o}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=i},function(e,t,r){"use strict";var n=r(9);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function n(){this.handlers=[]}var i=r(9);n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){i.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=n},function(e,t,r){"use strict";function n(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var i=r(9),a=r(189),o=r(76),s=r(46),f=r(190),u=r(191);e.exports=function(e){return n(e),e.baseURL&&!f(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return n(e),t.data=a(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(n(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new i(e),t(r.reason))})}var i=r(77);n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var e;return{token:new n(function(t){e=t}),cancel:e}},e.exports=n},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){(function(r){function n(e,t){if(e instanceof o)return e;if("string"!=typeof e)return null;if(e.length>Q)return null;if(!(t?J[ve]:J[de]).test(e))return null;try{return new o(e,t)}catch(e){return null}}function i(e,t){var r=n(e,t);return r?r.version:null}function a(e,t){var r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}function o(e,t){if(e instanceof o){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>Q)throw new TypeError("version is longer than "+Q+" characters");if(!(this instanceof o))return new o(e,t);G("SemVer",e,t),this.loose=t;var r=e.trim().match(t?J[ve]:J[de]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>$||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<$)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new o(e,r).inc(t,n).version}catch(e){return null}}function f(e,t){if(_(e,t))return null;var r=n(e),i=n(t);if(r.prerelease.length||i.prerelease.length){for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return"pre"+a;return"prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return a}function u(e,t){var r=He.test(e),n=He.test(t);return r&&n&&(e=+e,t=+t),r&&!n?-1:n&&!r?1:et?1:0}function c(e,t){return u(t,e)}function h(e,t){return new o(e,t).major}function l(e,t){return new o(e,t).minor}function d(e,t){return new o(e,t).patch}function p(e,t,r){return new o(e,r).compare(new o(t,r))}function b(e,t){return p(e,t,!0)}function v(e,t,r){return p(t,e,r)}function m(e,r){return e.sort(function(e,n){return t.compare(e,n,r)})}function g(e,r){return e.sort(function(e,n){return t.rcompare(e,n,r)})}function y(e,t,r){return p(e,t,r)>0}function w(e,t,r){return p(e,t,r)<0}function _(e,t,r){return 0===p(e,t,r)}function S(e,t,r){return 0!==p(e,t,r)}function k(e,t,r){return p(e,t,r)>=0}function x(e,t,r){return p(e,t,r)<=0}function A(e,t,r,n){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e===r;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e!==r;break;case"":case"=":case"==":i=_(e,r,n);break;case"!=":i=S(e,r,n);break;case">":i=y(e,r,n);break;case">=":i=k(e,r,n);break;case"<":i=w(e,r,n);break;case"<=":i=x(e,r,n);break;default:throw new TypeError("Invalid operator: "+t)}return i}function M(e,t){if(e instanceof M){if(e.loose===t)return e;e=e.value}if(!(this instanceof M))return new M(e,t);G("comparator",e,t),this.loose=t,this.parse(e),this.semver===Ue?this.value="":this.value=this.operator+this.semver.version,G("comp",this)}function E(e,t){if(e instanceof E)return e.loose===t?e:new E(e.raw,t);if(e instanceof M)return new E(e.value,t);if(!(this instanceof E))return new E(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function I(e,t){return new E(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function T(e,t){return G("comp",e),e=C(e,t),G("caret",e),e=R(e,t),G("tildes",e),e=N(e,t),G("xrange",e),e=z(e,t),G("stars",e),e}function P(e){return!e||"x"===e.toLowerCase()||"*"===e}function R(e,t){return e.trim().split(/\s+/).map(function(e){return B(e,t)}).join(" ")}function B(e,t){var r=t?J[Ie]:J[Ee];return e.replace(r,function(t,r,n,i,a){G("tilde",e,t,r,n,i,a);var o;return P(r)?o="":P(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":P(i)?o=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":a?(G("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),o=">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0"):o=">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0",G("tilde return",o),o})}function C(e,t){return e.trim().split(/\s+/).map(function(e){return O(e,t)}).join(" ")}function O(e,t){G("caret",e,t);var r=t?J[Be]:J[Re];return e.replace(r,function(t,r,n,i,a){G("caret",e,t,r,n,i,a);var o;return P(r)?o="":P(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":P(i)?o="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":a?(G("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),o="0"===r?"0"===n?">="+r+"."+n+"."+i+a+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+a+" <"+(+r+1)+".0.0"):(G("no pr"),o="0"===r?"0"===n?">="+r+"."+n+"."+i+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+" <"+(+r+1)+".0.0"),G("caret return",o),o})}function N(e,t){return G("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return j(e,t)}).join(" ")}function j(e,t){e=e.trim();var r=t?J[ke]:J[Se];return e.replace(r,function(t,r,n,i,a,o){G("xRange",e,t,r,n,i,a,o);var s=P(n),f=s||P(i),u=f||P(a),c=u;return"="===r&&c&&(r=""),s?t=">"===r||"<"===r?"<0.0.0":"*":r&&c?(f&&(i=0),u&&(a=0),">"===r?(r=">=",f?(n=+n+1,i=0,a=0):u&&(i=+i+1,a=0)):"<="===r&&(r="<",f?n=+n+1:i=+i+1),t=r+n+"."+i+"."+a):f?t=">="+n+".0.0 <"+(+n+1)+".0.0":u&&(t=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),G("xRange return",t),t})}function z(e,t){return G("replaceStars",e,t),e.trim().replace(J[Le],"")}function L(e,t,r,n,i,a,o,s,f,u,c,h,l){return t=P(r)?"":P(n)?">="+r+".0.0":P(i)?">="+r+"."+n+".0":">="+t,s=P(f)?"":P(u)?"<"+(+f+1)+".0.0":P(c)?"<"+f+"."+(+u+1)+".0":h?"<="+f+"."+u+"."+c+"-"+h:"<="+s,(t+" "+s).trim()}function F(e,t){for(var r=0;r0){var n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}function H(e,t,r){try{t=new E(t,r)}catch(e){return!1}return t.test(e)}function U(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function D(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function q(e,t){try{return new E(e,t).range||"*"}catch(e){return null}}function K(e,t,r){return V(e,t,"<",r)}function Y(e,t,r){return V(e,t,">",r)}function V(e,t,r,n){e=new o(e,n),t=new E(t,n);var i,a,s,f,u;switch(r){case">":i=y,a=x,s=w,f=">",u=">=";break;case"<":i=w,a=k,s=y,f="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(H(e,t,n))return!1;for(var c=0;c=0.0.0")),l=l||e,d=d||e,i(e.semver,l.semver,n)?l=e:s(e.semver,d.semver,n)&&(d=e)}),l.operator===f||l.operator===u)return!1;if((!d.operator||d.operator===f)&&a(e,d.semver))return!1;if(d.operator===u&&s(e,d.semver))return!1}return!0}function W(e,t){var r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}function X(e,t,r){return e=new E(e,r),t=new E(t,r),e.intersects(t)}function Z(e){if(e instanceof o)return e;if("string"!=typeof e)return null;var t=e.match(J[xe]);return null==t?null:n((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}t=e.exports=o;var G;G="object"==typeof r&&Object({NODE_ENV:"production"})&&Object({NODE_ENV:"production"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production"}).NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var Q=256,$=Number.MAX_SAFE_INTEGER||9007199254740991,J=t.re=[],ee=t.src=[],te=0,re=te++;ee[re]="0|[1-9]\\d*";var ne=te++;ee[ne]="[0-9]+";var ie=te++;ee[ie]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var ae=te++;ee[ae]="("+ee[re]+")\\.("+ee[re]+")\\.("+ee[re]+")";var oe=te++;ee[oe]="("+ee[ne]+")\\.("+ee[ne]+")\\.("+ee[ne]+")";var se=te++;ee[se]="(?:"+ee[re]+"|"+ee[ie]+")";var fe=te++;ee[fe]="(?:"+ee[ne]+"|"+ee[ie]+")";var ue=te++;ee[ue]="(?:-("+ee[se]+"(?:\\."+ee[se]+")*))";var ce=te++;ee[ce]="(?:-?("+ee[fe]+"(?:\\."+ee[fe]+")*))";var he=te++;ee[he]="[0-9A-Za-z-]+";var le=te++;ee[le]="(?:\\+("+ee[he]+"(?:\\."+ee[he]+")*))";var de=te++,pe="v?"+ee[ae]+ee[ue]+"?"+ee[le]+"?";ee[de]="^"+pe+"$";var be="[v=\\s]*"+ee[oe]+ee[ce]+"?"+ee[le]+"?",ve=te++;ee[ve]="^"+be+"$";var me=te++;ee[me]="((?:<|>)?=?)";var ge=te++;ee[ge]=ee[ne]+"|x|X|\\*";var ye=te++;ee[ye]=ee[re]+"|x|X|\\*";var we=te++;ee[we]="[v=\\s]*("+ee[ye]+")(?:\\.("+ee[ye]+")(?:\\.("+ee[ye]+")(?:"+ee[ue]+")?"+ee[le]+"?)?)?";var _e=te++;ee[_e]="[v=\\s]*("+ee[ge]+")(?:\\.("+ee[ge]+")(?:\\.("+ee[ge]+")(?:"+ee[ce]+")?"+ee[le]+"?)?)?";var Se=te++;ee[Se]="^"+ee[me]+"\\s*"+ee[we]+"$";var ke=te++;ee[ke]="^"+ee[me]+"\\s*"+ee[_e]+"$";var xe=te++;ee[xe]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Ae=te++;ee[Ae]="(?:~>?)";var Me=te++;ee[Me]="(\\s*)"+ee[Ae]+"\\s+",J[Me]=new RegExp(ee[Me],"g");var Ee=te++;ee[Ee]="^"+ee[Ae]+ee[we]+"$";var Ie=te++;ee[Ie]="^"+ee[Ae]+ee[_e]+"$";var Te=te++;ee[Te]="(?:\\^)";var Pe=te++;ee[Pe]="(\\s*)"+ee[Te]+"\\s+",J[Pe]=new RegExp(ee[Pe],"g");var Re=te++;ee[Re]="^"+ee[Te]+ee[we]+"$";var Be=te++;ee[Be]="^"+ee[Te]+ee[_e]+"$";var Ce=te++;ee[Ce]="^"+ee[me]+"\\s*("+be+")$|^$";var Oe=te++;ee[Oe]="^"+ee[me]+"\\s*("+pe+")$|^$";var Ne=te++;ee[Ne]="(\\s*)"+ee[me]+"\\s*("+be+"|"+ee[we]+")",J[Ne]=new RegExp(ee[Ne],"g");var je=te++;ee[je]="^\\s*("+ee[we]+")\\s+-\\s+("+ee[we]+")\\s*$";var ze=te++;ee[ze]="^\\s*("+ee[_e]+")\\s+-\\s+("+ee[_e]+")\\s*$";var Le=te++;ee[Le]="(<|>)?=?\\s*\\*";for(var Fe=0;Fe=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=s,t.diff=f,t.compareIdentifiers=u;var He=/^[0-9]+$/;t.rcompareIdentifiers=c,t.major=h,t.minor=l,t.patch=d,t.compare=p,t.compareLoose=b,t.rcompare=v,t.sort=m,t.rsort=g,t.gt=y,t.lt=w,t.eq=_,t.neq=S,t.gte=k,t.lte=x,t.cmp=A,t.Comparator=M;var Ue={};M.prototype.parse=function(e){var t=this.loose?J[Ce]:J[Oe],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new o(r[2],this.loose):this.semver=Ue},M.prototype.toString=function(){return this.value},M.prototype.test=function(e){return G("Comparator.test",e,this.loose),this.semver===Ue||("string"==typeof e&&(e=new o(e,this.loose)),A(e,this.operator,this.semver,this.loose))},M.prototype.intersects=function(e,t){if(!(e instanceof M))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new E(e.value,t),H(this.value,r,t);if(""===e.operator)return r=new E(this.value,t),H(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),a=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=A(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),f=A(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||a&&o||s||f},t.Range=E,E.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),G("range",e,t);var r=t?J[ze]:J[je];e=e.replace(r,L),G("hyphen replace",e),e=e.replace(J[Ne],"$1$2$3"),G("comparator trim",e,J[Ne]),e=e.replace(J[Me],"$1~"),e=e.replace(J[Pe],"$1^"),e=e.split(/\s+/).join(" ");var n=t?J[Ce]:J[Oe],i=e.split(" ").map(function(e){return T(e,t)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(e){return!!e.match(n)})),i=i.map(function(e){return new M(e,t)})},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return e.set.some(function(e){return e.every(function(e){return r.intersects(e,t)})})})})},t.toComparators=I,E.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new o(e,this.loose));for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:c.DEFAULT_WALLET,r=t.name,n=void 0===r?"myWallet":r,a=t.version,o=void 0===a?c.DEFAULT_WALLET.version:a,s=t.scrypt,f=void 0===s?{}:s,u=t.accounts,h=void 0===u?[]:u,l=t.extra,p=void 0===l?null:l;i(this,e),this.name=n,this.version=o,this.scrypt=f,this.accounts=[];var b=!0,v=!1,m=void 0;try{for(var g,y=h[Symbol.iterator]();!(b=(g=y.next()).done);b=!0){var w=g.value;this.addAccount(w)}}catch(e){v=!0,m=e}finally{try{!b&&y.return&&y.return()}finally{if(v)throw m}}this.extra=p,d.info("New Wallet created: "+this.name)}return a(e,[{key:"addAccount",value:function(e){var t=this.accounts.length;e instanceof u.default||(e=new u.default(e)),this.accounts.push(e);try{var r=e.address;d.info("Added Account: "+r+" to Wallet "+this.name)}catch(e){d.warn("Encrypted account added to Wallet "+this.name+". You will not be able to export this wallet without first decrypting this account")}return t}},{key:"decrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].decrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"decryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.decrypt(i,e))}),d.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"encrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].encrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"encryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.encrypt(i,e))}),d.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"export",value:function(){return{name:this.name,version:this.version,scrypt:this.scrypt,accounts:this.accounts.map(function(e){return e.export()}),extra:this.extra}}},{key:"setDefault",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=t.address||"",this.net=t.net||"NoNet",this.claims=t.claims?t.claims.map(function(e){return(0,a.ClaimItem)(e)}):[]}return i(e,[{key:s.default.inspect.custom,value:function(e,t){var r=this.claims.map(function(e){return e.txid+" <"+e.index+">: "+e.claim.toString()});return"[Claims("+this.net+"): "+this.address+"]\n"+JSON.stringify(r,null,2)}},{key:"export",value:function(){return{address:this.address,net:this.net,claims:this.claims.map(u)}}},{key:"slice",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new e({address:this.address,net:this.net,claims:this.claims.slice(t,r)})}},{key:Symbol.toStringTag,get:function(){return"Claims"}}]),e}();t.default=f;var u=function(e){return{claim:e.claim.toNumber(),txid:e.txid,index:e.index,value:e.value,start:e.start?e.start.toNumber():null,end:e.end?e.end.toNumber():null}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"NEO",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd";return d.warn("This is deprecated in favor of getPrices. There is a known bug for NEP5 tokens with this function."),o("https://api.coinmarketcap.com/v1/ticker/"+e.toLowerCase()+"/",t).then(function(t){var r=t[e.toUpperCase()];if(r)return r;throw new Error("Something went wrong with the CoinMarketCap API!")}).catch(function(e){throw d.error(e.message),e})},t.getPrices=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["NEO"];return o("https://api.coinmarketcap.com/v1/ticker/",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd").then(function(t){e=e.map(function(e){return e.toUpperCase()});var r=f.apply(void 0,[t].concat(a(e)));if(e.some(function(e){return!r[e]}))throw new Error("None of the coin symbols are supported by CoinMarketCap!");return r}).catch(function(e){throw d.error(e.message),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTransferToken=t.getToken=t.getTokenBalance=t.getTokenInfo=void 0;var n=r(45),i=r(11),a=r(24),o=r(2),s=r(47),f=r(21),u=r(4),c=r(6),h=function(e){return e&&e.__esModule?e:{default:e}}(c),l=(0,h.default)("api"),d=function(e){return""===e?0:parseInt(e,10)},p=function(e){return e?parseInt((0,o.reverseHex)(e),16):0},b=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,d,p),v=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,d,p,p);t.getTokenInfo=function(e,t){var r=new n.ScriptBuilder;r.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply");var i=r.str;return a.Query.invokeScript(i,!1).parseWith(b).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2])}}).catch(function(e){throw l.error("getTokenInfo failed with : "+e.message),e})},t.getTokenBalance=function(e,t,r){var s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r)),f=new n.ScriptBuilder,u=f.emitAppCall(t,"decimals").emitAppCall(t,"balanceOf",[s]).str;return a.Query.invokeScript(u,!1).execute(e).then(function(e){try{var t=d(e.result.stack[0].value);return p(e.result.stack[1].value)/Math.pow(10,t)}catch(e){return 0}}).catch(function(e){throw l.error("getTokenBalance failed with : "+e.message),e})},t.getToken=function(e,t,r){var s=r?v:b,f=new n.ScriptBuilder;if(f.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply"),r){var u=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r));f.emitAppCall(t,"balanceOf",[u])}var c=f.str;return a.Query.invokeScript(c,!1).parseWith(s).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2]),balance:5===e.length?e[4]/Math.pow(10,e[2]):null}}).catch(function(e){throw l.error("getToken failed with : "+e.message),e})},t.doTransferToken=function(e,t,r,n,c){var h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;l.warn("doTransferToken will be deprecated in favor of doInvoke");var p=new i.Account(r),b=(0,s.getRPCEndpoint)(e),v=(0,s.getBalance)(e,p.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var r=e[1],a=(0,i.getScriptHashFromAddress)(p.address),s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(n)),l=[{assetId:u.ASSET_ID.GAS,value:1e-8,scriptHash:a}],b={scriptHash:t,operation:"transfer",args:[(0,o.reverseHex)(a),s,c]},v=f.Transaction.createInvocationTx(r,l,b,h,{version:1});return d?d(v,p.publicKey):v.sign(p.privateKey)}).then(function(e){return m=e,a.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})}}])}); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},function(e,t,r){"use strict";function n(e){this.defaults=e,this.interceptors={request:new o,response:new o}}var i=r(46),a=r(9),o=r(188),s=r(189);n.prototype.request=function(e){"string"==typeof e&&(e=a.merge({url:arguments[0]},arguments[1])),e=a.merge(i,this.defaults,{method:"get"},e),e.method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},a.forEach(["delete","get","head","options"],function(e){n.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))}}),a.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=n},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(75);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e}},function(e,t,r){"use strict";function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=r(9);e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(i.isURLSearchParams(t))a=t.toString();else{var o=[];i.forEach(t,function(e,t){null!==e&&void 0!==e&&(i.isArray(e)&&(t+="[]"),i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),o.push(n(t)+"="+n(e))}))}),a=o.join("&")}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e}},function(e,t,r){"use strict";var n=r(9),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}}),o):o}},function(e,t,r){"use strict";var n=r(9);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(r){var i=n.isString(r)?e(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";function n(){this.message="String contains an invalid character"}function i(e){for(var t,r,i=String(e),o="",s=0,f=a;i.charAt(0|s)||(f="=",s%1);o+=f.charAt(63&t>>8-s%1*8)){if((r=i.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return o}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=i},function(e,t,r){"use strict";var n=r(9);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function n(){this.handlers=[]}var i=r(9);n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){i.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=n},function(e,t,r){"use strict";function n(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var i=r(9),a=r(190),o=r(76),s=r(46),f=r(191),u=r(192);e.exports=function(e){return n(e),e.baseURL&&!f(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return n(e),t.data=a(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(n(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new i(e),t(r.reason))})}var i=r(77);n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var e;return{token:new n(function(t){e=t}),cancel:e}},e.exports=n},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){(function(r){function n(e,t){if(e instanceof o)return e;if("string"!=typeof e)return null;if(e.length>Q)return null;if(!(t?J[ve]:J[de]).test(e))return null;try{return new o(e,t)}catch(e){return null}}function i(e,t){var r=n(e,t);return r?r.version:null}function a(e,t){var r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}function o(e,t){if(e instanceof o){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>Q)throw new TypeError("version is longer than "+Q+" characters");if(!(this instanceof o))return new o(e,t);G("SemVer",e,t),this.loose=t;var r=e.trim().match(t?J[ve]:J[de]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>$||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<$)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new o(e,r).inc(t,n).version}catch(e){return null}}function f(e,t){if(_(e,t))return null;var r=n(e),i=n(t);if(r.prerelease.length||i.prerelease.length){for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return"pre"+a;return"prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return a}function u(e,t){var r=Fe.test(e),n=Fe.test(t);return r&&n&&(e=+e,t=+t),r&&!n?-1:n&&!r?1:et?1:0}function c(e,t){return u(t,e)}function h(e,t){return new o(e,t).major}function l(e,t){return new o(e,t).minor}function d(e,t){return new o(e,t).patch}function p(e,t,r){return new o(e,r).compare(new o(t,r))}function b(e,t){return p(e,t,!0)}function v(e,t,r){return p(t,e,r)}function m(e,r){return e.sort(function(e,n){return t.compare(e,n,r)})}function g(e,r){return e.sort(function(e,n){return t.rcompare(e,n,r)})}function y(e,t,r){return p(e,t,r)>0}function w(e,t,r){return p(e,t,r)<0}function _(e,t,r){return 0===p(e,t,r)}function S(e,t,r){return 0!==p(e,t,r)}function k(e,t,r){return p(e,t,r)>=0}function x(e,t,r){return p(e,t,r)<=0}function A(e,t,r,n){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e===r;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e!==r;break;case"":case"=":case"==":i=_(e,r,n);break;case"!=":i=S(e,r,n);break;case">":i=y(e,r,n);break;case">=":i=k(e,r,n);break;case"<":i=w(e,r,n);break;case"<=":i=x(e,r,n);break;default:throw new TypeError("Invalid operator: "+t)}return i}function M(e,t){if(e instanceof M){if(e.loose===t)return e;e=e.value}if(!(this instanceof M))return new M(e,t);G("comparator",e,t),this.loose=t,this.parse(e),this.semver===Ue?this.value="":this.value=this.operator+this.semver.version,G("comp",this)}function E(e,t){if(e instanceof E)return e.loose===t?e:new E(e.raw,t);if(e instanceof M)return new E(e.value,t);if(!(this instanceof E))return new E(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function I(e,t){return new E(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function T(e,t){return G("comp",e),e=C(e,t),G("caret",e),e=P(e,t),G("tildes",e),e=N(e,t),G("xrange",e),e=z(e,t),G("stars",e),e}function R(e){return!e||"x"===e.toLowerCase()||"*"===e}function P(e,t){return e.trim().split(/\s+/).map(function(e){return B(e,t)}).join(" ")}function B(e,t){var r=t?J[Ie]:J[Ee];return e.replace(r,function(t,r,n,i,a){G("tilde",e,t,r,n,i,a);var o;return R(r)?o="":R(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":R(i)?o=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":a?(G("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),o=">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0"):o=">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0",G("tilde return",o),o})}function C(e,t){return e.trim().split(/\s+/).map(function(e){return O(e,t)}).join(" ")}function O(e,t){G("caret",e,t);var r=t?J[Be]:J[Pe];return e.replace(r,function(t,r,n,i,a){G("caret",e,t,r,n,i,a);var o;return R(r)?o="":R(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":R(i)?o="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":a?(G("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),o="0"===r?"0"===n?">="+r+"."+n+"."+i+a+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+a+" <"+(+r+1)+".0.0"):(G("no pr"),o="0"===r?"0"===n?">="+r+"."+n+"."+i+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+" <"+(+r+1)+".0.0"),G("caret return",o),o})}function N(e,t){return G("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return j(e,t)}).join(" ")}function j(e,t){e=e.trim();var r=t?J[ke]:J[Se];return e.replace(r,function(t,r,n,i,a,o){G("xRange",e,t,r,n,i,a,o);var s=R(n),f=s||R(i),u=f||R(a),c=u;return"="===r&&c&&(r=""),s?t=">"===r||"<"===r?"<0.0.0":"*":r&&c?(f&&(i=0),u&&(a=0),">"===r?(r=">=",f?(n=+n+1,i=0,a=0):u&&(i=+i+1,a=0)):"<="===r&&(r="<",f?n=+n+1:i=+i+1),t=r+n+"."+i+"."+a):f?t=">="+n+".0.0 <"+(+n+1)+".0.0":u&&(t=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),G("xRange return",t),t})}function z(e,t){return G("replaceStars",e,t),e.trim().replace(J[Le],"")}function L(e,t,r,n,i,a,o,s,f,u,c,h,l){return t=R(r)?"":R(n)?">="+r+".0.0":R(i)?">="+r+"."+n+".0":">="+t,s=R(f)?"":R(u)?"<"+(+f+1)+".0.0":R(c)?"<"+f+"."+(+u+1)+".0":h?"<="+f+"."+u+"."+c+"-"+h:"<="+s,(t+" "+s).trim()}function H(e,t){for(var r=0;r0){var n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}function F(e,t,r){try{t=new E(t,r)}catch(e){return!1}return t.test(e)}function U(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function D(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function q(e,t){try{return new E(e,t).range||"*"}catch(e){return null}}function K(e,t,r){return V(e,t,"<",r)}function Y(e,t,r){return V(e,t,">",r)}function V(e,t,r,n){e=new o(e,n),t=new E(t,n);var i,a,s,f,u;switch(r){case">":i=y,a=x,s=w,f=">",u=">=";break;case"<":i=w,a=k,s=y,f="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,t,n))return!1;for(var c=0;c=0.0.0")),l=l||e,d=d||e,i(e.semver,l.semver,n)?l=e:s(e.semver,d.semver,n)&&(d=e)}),l.operator===f||l.operator===u)return!1;if((!d.operator||d.operator===f)&&a(e,d.semver))return!1;if(d.operator===u&&s(e,d.semver))return!1}return!0}function W(e,t){var r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}function X(e,t,r){return e=new E(e,r),t=new E(t,r),e.intersects(t)}function Z(e){if(e instanceof o)return e;if("string"!=typeof e)return null;var t=e.match(J[xe]);return null==t?null:n((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}t=e.exports=o;var G;G="object"==typeof r&&Object({NODE_ENV:"production"})&&Object({NODE_ENV:"production"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production"}).NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var Q=256,$=Number.MAX_SAFE_INTEGER||9007199254740991,J=t.re=[],ee=t.src=[],te=0,re=te++;ee[re]="0|[1-9]\\d*";var ne=te++;ee[ne]="[0-9]+";var ie=te++;ee[ie]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var ae=te++;ee[ae]="("+ee[re]+")\\.("+ee[re]+")\\.("+ee[re]+")";var oe=te++;ee[oe]="("+ee[ne]+")\\.("+ee[ne]+")\\.("+ee[ne]+")";var se=te++;ee[se]="(?:"+ee[re]+"|"+ee[ie]+")";var fe=te++;ee[fe]="(?:"+ee[ne]+"|"+ee[ie]+")";var ue=te++;ee[ue]="(?:-("+ee[se]+"(?:\\."+ee[se]+")*))";var ce=te++;ee[ce]="(?:-?("+ee[fe]+"(?:\\."+ee[fe]+")*))";var he=te++;ee[he]="[0-9A-Za-z-]+";var le=te++;ee[le]="(?:\\+("+ee[he]+"(?:\\."+ee[he]+")*))";var de=te++,pe="v?"+ee[ae]+ee[ue]+"?"+ee[le]+"?";ee[de]="^"+pe+"$";var be="[v=\\s]*"+ee[oe]+ee[ce]+"?"+ee[le]+"?",ve=te++;ee[ve]="^"+be+"$";var me=te++;ee[me]="((?:<|>)?=?)";var ge=te++;ee[ge]=ee[ne]+"|x|X|\\*";var ye=te++;ee[ye]=ee[re]+"|x|X|\\*";var we=te++;ee[we]="[v=\\s]*("+ee[ye]+")(?:\\.("+ee[ye]+")(?:\\.("+ee[ye]+")(?:"+ee[ue]+")?"+ee[le]+"?)?)?";var _e=te++;ee[_e]="[v=\\s]*("+ee[ge]+")(?:\\.("+ee[ge]+")(?:\\.("+ee[ge]+")(?:"+ee[ce]+")?"+ee[le]+"?)?)?";var Se=te++;ee[Se]="^"+ee[me]+"\\s*"+ee[we]+"$";var ke=te++;ee[ke]="^"+ee[me]+"\\s*"+ee[_e]+"$";var xe=te++;ee[xe]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Ae=te++;ee[Ae]="(?:~>?)";var Me=te++;ee[Me]="(\\s*)"+ee[Ae]+"\\s+",J[Me]=new RegExp(ee[Me],"g");var Ee=te++;ee[Ee]="^"+ee[Ae]+ee[we]+"$";var Ie=te++;ee[Ie]="^"+ee[Ae]+ee[_e]+"$";var Te=te++;ee[Te]="(?:\\^)";var Re=te++;ee[Re]="(\\s*)"+ee[Te]+"\\s+",J[Re]=new RegExp(ee[Re],"g");var Pe=te++;ee[Pe]="^"+ee[Te]+ee[we]+"$";var Be=te++;ee[Be]="^"+ee[Te]+ee[_e]+"$";var Ce=te++;ee[Ce]="^"+ee[me]+"\\s*("+be+")$|^$";var Oe=te++;ee[Oe]="^"+ee[me]+"\\s*("+pe+")$|^$";var Ne=te++;ee[Ne]="(\\s*)"+ee[me]+"\\s*("+be+"|"+ee[we]+")",J[Ne]=new RegExp(ee[Ne],"g");var je=te++;ee[je]="^\\s*("+ee[we]+")\\s+-\\s+("+ee[we]+")\\s*$";var ze=te++;ee[ze]="^\\s*("+ee[_e]+")\\s+-\\s+("+ee[_e]+")\\s*$";var Le=te++;ee[Le]="(<|>)?=?\\s*\\*";for(var He=0;He=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=s,t.diff=f,t.compareIdentifiers=u;var Fe=/^[0-9]+$/;t.rcompareIdentifiers=c,t.major=h,t.minor=l,t.patch=d,t.compare=p,t.compareLoose=b,t.rcompare=v,t.sort=m,t.rsort=g,t.gt=y,t.lt=w,t.eq=_,t.neq=S,t.gte=k,t.lte=x,t.cmp=A,t.Comparator=M;var Ue={};M.prototype.parse=function(e){var t=this.loose?J[Ce]:J[Oe],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new o(r[2],this.loose):this.semver=Ue},M.prototype.toString=function(){return this.value},M.prototype.test=function(e){return G("Comparator.test",e,this.loose),this.semver===Ue||("string"==typeof e&&(e=new o(e,this.loose)),A(e,this.operator,this.semver,this.loose))},M.prototype.intersects=function(e,t){if(!(e instanceof M))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new E(e.value,t),F(this.value,r,t);if(""===e.operator)return r=new E(this.value,t),F(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),a=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=A(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),f=A(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||a&&o||s||f},t.Range=E,E.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),G("range",e,t);var r=t?J[ze]:J[je];e=e.replace(r,L),G("hyphen replace",e),e=e.replace(J[Ne],"$1$2$3"),G("comparator trim",e,J[Ne]),e=e.replace(J[Me],"$1~"),e=e.replace(J[Re],"$1^"),e=e.split(/\s+/).join(" ");var n=t?J[Ce]:J[Oe],i=e.split(" ").map(function(e){return T(e,t)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(e){return!!e.match(n)})),i=i.map(function(e){return new M(e,t)})},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return e.set.some(function(e){return e.every(function(e){return r.intersects(e,t)})})})})},t.toComparators=I,E.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new o(e,this.loose));for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:c.DEFAULT_WALLET,r=t.name,n=void 0===r?"myWallet":r,a=t.version,o=void 0===a?c.DEFAULT_WALLET.version:a,s=t.scrypt,f=void 0===s?{}:s,u=t.accounts,h=void 0===u?[]:u,l=t.extra,p=void 0===l?null:l;i(this,e),this.name=n,this.version=o,this.scrypt=f,this.accounts=[];var b=!0,v=!1,m=void 0;try{for(var g,y=h[Symbol.iterator]();!(b=(g=y.next()).done);b=!0){var w=g.value;this.addAccount(w)}}catch(e){v=!0,m=e}finally{try{!b&&y.return&&y.return()}finally{if(v)throw m}}this.extra=p,d.info("New Wallet created: "+this.name)}return a(e,[{key:"addAccount",value:function(e){var t=this.accounts.length;e instanceof u.default||(e=new u.default(e)),this.accounts.push(e);try{var r=e.address;d.info("Added Account: "+r+" to Wallet "+this.name)}catch(e){d.warn("Encrypted account added to Wallet "+this.name+". You will not be able to export this wallet without first decrypting this account")}return t}},{key:"decrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].decrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"decryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.decrypt(i,e))}),d.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"encrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].encrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"encryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.encrypt(i,e))}),d.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"export",value:function(){return{name:this.name,version:this.version,scrypt:this.scrypt,accounts:this.accounts.map(function(e){return e.export()}),extra:this.extra}}},{key:"setDefault",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=t.address||"",this.net=t.net||"NoNet",this.claims=t.claims?t.claims.map(function(e){return(0,a.ClaimItem)(e)}):[]}return i(e,[{key:s.default.inspect.custom,value:function(e,t){var r=this.claims.map(function(e){return e.txid+" <"+e.index+">: "+e.claim.toString()});return"[Claims("+this.net+"): "+this.address+"]\n"+JSON.stringify(r,null,2)}},{key:"export",value:function(){return{address:this.address,net:this.net,claims:this.claims.map(u)}}},{key:"slice",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new e({address:this.address,net:this.net,claims:this.claims.slice(t,r)})}},{key:Symbol.toStringTag,get:function(){return"Claims"}}]),e}();t.default=f;var u=function(e){return{claim:e.claim.toNumber(),txid:e.txid,index:e.index,value:e.value,start:e.start?e.start.toNumber():null,end:e.end?e.end.toNumber():null}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"NEO",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd";return d.warn("This is deprecated in favor of getPrices. There is a known bug for NEP5 tokens with this function."),o("https://api.coinmarketcap.com/v1/ticker/"+e.toLowerCase()+"/",t).then(function(t){var r=t[e.toUpperCase()];if(r)return r;throw new Error("Something went wrong with the CoinMarketCap API!")}).catch(function(e){throw d.error(e.message),e})},t.getPrices=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["NEO"];return o("https://api.coinmarketcap.com/v1/ticker/",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd").then(function(t){e=e.map(function(e){return e.toUpperCase()});var r=f.apply(void 0,[t].concat(a(e)));if(e.some(function(e){return!r[e]}))throw new Error("None of the coin symbols are supported by CoinMarketCap!");return r}).catch(function(e){throw d.error(e.message),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTransferToken=t.getToken=t.getTokenBalance=t.getTokenInfo=void 0;var n=r(45),i=r(11),a=r(24),o=r(2),s=r(47),f=r(21),u=r(4),c=r(6),h=function(e){return e&&e.__esModule?e:{default:e}}(c),l=(0,h.default)("api"),d=function(e){return""===e?0:parseInt(e,10)},p=function(e){return e?parseInt((0,o.reverseHex)(e),16):0},b=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,d,p),v=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,d,p,p);t.getTokenInfo=function(e,t){var r=new n.ScriptBuilder;r.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply");var i=r.str;return a.Query.invokeScript(i,!1).parseWith(b).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2])}}).catch(function(e){throw l.error("getTokenInfo failed with : "+e.message),e})},t.getTokenBalance=function(e,t,r){var s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r)),f=new n.ScriptBuilder,u=f.emitAppCall(t,"decimals").emitAppCall(t,"balanceOf",[s]).str;return a.Query.invokeScript(u,!1).execute(e).then(function(e){try{var t=d(e.result.stack[0].value);return p(e.result.stack[1].value)/Math.pow(10,t)}catch(e){return 0}}).catch(function(e){throw l.error("getTokenBalance failed with : "+e.message),e})},t.getToken=function(e,t,r){var s=r?v:b,f=new n.ScriptBuilder;if(f.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply"),r){var u=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r));f.emitAppCall(t,"balanceOf",[u])}var c=f.str;return a.Query.invokeScript(c,!1).parseWith(s).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2]),balance:5===e.length?e[4]/Math.pow(10,e[2]):null}}).catch(function(e){throw l.error("getToken failed with : "+e.message),e})},t.doTransferToken=function(e,t,r,n,c){var h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;l.warn("doTransferToken will be deprecated in favor of doInvoke");var p=new i.Account(r),b=(0,s.getRPCEndpoint)(e),v=(0,s.getBalance)(e,p.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var r=e[1],a=(0,i.getScriptHashFromAddress)(p.address),s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(n)),l=[{assetId:u.ASSET_ID.GAS,value:1e-8,scriptHash:a}],b={scriptHash:t,operation:"transfer",args:[(0,o.reverseHex)(a),s,c]},v=f.Transaction.createInvocationTx(r,l,b,h,{version:1});return d?d(v,p.publicKey):v.sign(p.privateKey)}).then(function(e){return m=e,a.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})}}])}); \ No newline at end of file diff --git a/lib/browser.js.gz b/lib/browser.js.gz index 043c147a1..9a7772aca 100644 Binary files a/lib/browser.js.gz and b/lib/browser.js.gz differ diff --git a/lib/index.js b/lib/index.js index 0e3bf3f54..590846832 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=69)}([function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var c=f*a,u=e.min(4*c,i);if(c){for(var d=0;d1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(t%1!=0)throw new Error("size must be a whole integer");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");t*=2;var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=w(n)),n}),w=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;if("number"!=typeof e)throw new Error("num must be numeric");if(t%1!=0)throw new Error("size must be a whole integer");return new S(e.toFixed(8)).toReverseHex().slice(0,2*t)},t.fixed82num=function(e){return x(e),""===e?0:S.fromReverseHex(e).toNumber()},t.num2VarInt=function(e){return e<253?y(e):e<=65535?"fd"+y(e,2,!0):e<=4294967295?"fe"+y(e,4,!0):"ff"+y(e,8,!0)},t.hexXor=function(e,t){if(x(e),x(t),e.length!==t.length)throw new Error("strings are disparate lengths");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t}),_=/^([0-9A-Fa-f]{2})*$/,k=t.isHex=function(e){try{return _.test(e)}catch(e){return!1}},x=t.ensureHex=function(e){if(!k(e))throw new Error("Expected a hexstring but got "+e)},S=(t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.str=t,this.pter=0}return f(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(w(this.read(2)),16):254===e?e=parseInt(w(this.read(4)),16):255===e&&(e=parseInt(w(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e),r=(0,u.SHA256)(t);return(0,u.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e),r=(0,u.SHA256)(t);return(0,u.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e);return(0,u.SHA256)(t).toString()},t.Fixed8=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return o(this,t),"number"==typeof e&&(e=e.toFixed(8)),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),f(t,[{key:"toHex",value:function(){var e=this.mul(1e8).round().toString(16);return"0".repeat(16-e.length)+e}},{key:"toReverseHex",value:function(){return w(this.toHex())}},{key:p.default.inspect.custom,value:function(e,t){return this.toFixed(8)}},{key:"ceil",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ceil",this).call(this))}},{key:"floor",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"floor",this).call(this))}},{key:"round",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"round",this).call(this,e,r))}},{key:"div",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.dividedBy(e,t)}},{key:"dividedBy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dividedBy",this).call(this,e,r))}},{key:"mul",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.times(e,t)}},{key:"times",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"times",this).call(this,e,r))}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.plus(e,t)}},{key:"plus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"plus",this).call(this,e,r))}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.minus(e,t)}},{key:"minus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"minus",this).call(this,e,r))}}],[{key:"fromHex",value:function(e){return new t(e,16).div(1e8)}},{key:"fromReverseHex",value:function(e){return this.fromHex(w(e))}}]),t}(l.default))},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(11))}(0,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc,f=(s.Utf8,s.Base64),c=r.algo,u=c.EvpKDF,d=n.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?x:w}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),l=(n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),h=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=l.CBC=function(){function e(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else var a=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:v}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=r.format={},y=g.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},k=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},x=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:k}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654",TEST_NXT:"0b6c1f919e95fe61c17a7612aebfaf4fda3a2214",TEST_RHTT4:"f9572c5b119a6b5775a6af07f1cef5d310038f55"},t.TEST_NXT_ADDRESS="AHcLAfnvzzHyuPPULeXrXZ6RK3Hkdvi1qi",t.DEFAULT_RPC={MAIN:"https://seed1.neo.org:10331",TEST:"https://seed1.neo.org:20331"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.DEFAULT_ACCOUNT_CONTRACT={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(133),a=n(i),o=r(134),s=n(o);a.default.setDefaultLevel("silent"),a.default.setAll=function(e){Object.keys(a.default.getLoggers()).map(function(t){a.default.getLogger(t).setLevel(e)})};var f=function(e,t){var r=(new Date).toUTCString();return e=e.toUpperCase(),"["+r+"] ("+t+") "+e+": "};t.default=function(e){var t=a.default.getLogger(e);return s.default.apply(t,{format:f}),t};t.logger=a.default},function(e,t,r){"use strict";function n(e){return"[object Array]"===S.call(e)}function i(e){return"[object ArrayBuffer]"===S.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function c(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===S.call(e)}function l(e){return"[object File]"===S.call(e)}function h(e){return"[object Blob]"===S.call(e)}function p(e){return"[object Function]"===S.call(e)}function b(e){return u(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function y(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),n(e))for(var r=0,i=e.length;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function u(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function d(e,t){return e>>>t|e<<32-t}function l(e,t){return e<>>32-t}function h(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,c=t;return c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function k(e,t,r,n,i,a,o,s,f,c){var u=0,d=t;return d=d+n>>>0,u+=d>>0,u+=d>>0,u+=d>>0,u+=d>>0}function x(e,t,r,n,i,a,o,s,f,c){return t+n+a+s+c>>>0}function S(e,t,r){return(t<<32-r|e>>>r)>>>0}function A(e,t,r){return(e<<32-r|t>>>r)>>>0}function M(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var C=r(10),I=r(19);t.inherits=I,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=c,t.split32=u,t.rotr32=d,t.rotl32=l,t.sum32=h,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=k,t.sum64_5_lo=x,t.rotr64_hi=S,t.rotr64_lo=A,t.shr64_hi=M,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function c(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&f,l=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=l;h++){var p=c-h|0;i=0|e.words[p],a=0|t.words[h],o=i*a+d,u+=o/67108864|0,d=67108863&o}r.words[c]=0|d,f=0|u}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function u(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function d(e,t,r){return(new l).mulp(e,t,r)}function l(e,t){this.x=e,this.y=t}function h(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(38).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","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"],k=[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],x=[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];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=k[e],u=x[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var l=d.modn(u).toString(e);d=d.idivn(u),r=d.isZero()?l+r:_[c-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,c=new e(a),u=this.clone();if(f){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,h=0|o[1],p=8191&h,b=h>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,A=0|o[5],M=8191&A,E=A>>>13,C=0|o[6],I=8191&C,T=C>>>13,P=0|o[7],R=8191&P,B=P>>>13,O=0|o[8],N=8191&O,F=O>>>13,j=0|o[9],z=8191&j,H=j>>>13,q=0|s[0],L=8191&q,D=q>>>13,U=0|s[1],K=8191&U,V=U>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,$=0|s[4],J=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,le=ue>>>13,he=0|s[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(d,L),i=Math.imul(d,D),i=i+Math.imul(l,L)|0,a=Math.imul(l,D);var ve=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,L),i=Math.imul(p,D),i=i+Math.imul(b,L)|0,a=Math.imul(b,D),n=n+Math.imul(d,K)|0,i=i+Math.imul(d,V)|0,i=i+Math.imul(l,K)|0,a=a+Math.imul(l,V)|0;var me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,L),i=Math.imul(m,D),i=i+Math.imul(g,L)|0,a=Math.imul(g,D),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,n=n+Math.imul(d,W)|0,i=i+Math.imul(d,X)|0,i=i+Math.imul(l,W)|0,a=a+Math.imul(l,X)|0;var ge=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,L),i=Math.imul(w,D),i=i+Math.imul(_,L)|0,a=Math.imul(_,D),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,V)|0,i=i+Math.imul(g,K)|0,a=a+Math.imul(g,V)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(d,G)|0,i=i+Math.imul(d,Q)|0,i=i+Math.imul(l,G)|0,a=a+Math.imul(l,Q)|0;var ye=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(x,L),i=Math.imul(x,D),i=i+Math.imul(S,L)|0,a=Math.imul(S,D),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,V)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(d,J)|0,i=i+Math.imul(d,ee)|0,i=i+Math.imul(l,J)|0,a=a+Math.imul(l,ee)|0;var we=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,L),i=Math.imul(M,D),i=i+Math.imul(E,L)|0,a=Math.imul(E,D),n=n+Math.imul(x,K)|0,i=i+Math.imul(x,V)|0,i=i+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(g,G)|0,a=a+Math.imul(g,Q)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,J)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(d,re)|0,i=i+Math.imul(d,ne)|0,i=i+Math.imul(l,re)|0,a=a+Math.imul(l,ne)|0;var _e=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,L),i=Math.imul(I,D),i=i+Math.imul(T,L)|0,a=Math.imul(T,D),n=n+Math.imul(M,K)|0,i=i+Math.imul(M,V)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,V)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,X)|0,i=i+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,J)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(d,ae)|0,i=i+Math.imul(d,oe)|0,i=i+Math.imul(l,ae)|0,a=a+Math.imul(l,oe)|0;var ke=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,L),i=Math.imul(R,D),i=i+Math.imul(B,L)|0,a=Math.imul(B,D),n=n+Math.imul(I,K)|0,i=i+Math.imul(I,V)|0,i=i+Math.imul(T,K)|0,a=a+Math.imul(T,V)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(x,G)|0,i=i+Math.imul(x,Q)|0,i=i+Math.imul(S,G)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(d,fe)|0,i=i+Math.imul(d,ce)|0,i=i+Math.imul(l,fe)|0,a=a+Math.imul(l,ce)|0;var xe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,L),i=Math.imul(N,D),i=i+Math.imul(F,L)|0,a=Math.imul(F,D),n=n+Math.imul(R,K)|0,i=i+Math.imul(R,V)|0,i=i+Math.imul(B,K)|0,a=a+Math.imul(B,V)|0,n=n+Math.imul(I,W)|0,i=i+Math.imul(I,X)|0,i=i+Math.imul(T,W)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(M,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,ee)|0,i=i+Math.imul(S,J)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ce)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0,n=n+Math.imul(d,de)|0,i=i+Math.imul(d,le)|0,i=i+Math.imul(l,de)|0,a=a+Math.imul(l,le)|0;var Se=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,L),i=Math.imul(z,D),i=i+Math.imul(H,L)|0,a=Math.imul(H,D),n=n+Math.imul(N,K)|0,i=i+Math.imul(N,V)|0,i=i+Math.imul(F,K)|0,a=a+Math.imul(F,V)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(B,W)|0,a=a+Math.imul(B,X)|0,n=n+Math.imul(I,G)|0,i=i+Math.imul(I,Q)|0,i=i+Math.imul(T,G)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,i=i+Math.imul(E,J)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,i=i+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ce)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ce)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0,i=i+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0,n=n+Math.imul(d,pe)|0,i=i+Math.imul(d,be)|0,i=i+Math.imul(l,pe)|0,a=a+Math.imul(l,be)|0;var Ae=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,K),i=Math.imul(z,V),i=i+Math.imul(H,K)|0,a=Math.imul(H,V),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,Q)|0,i=i+Math.imul(B,G)|0,a=a+Math.imul(B,Q)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,ee)|0,i=i+Math.imul(T,J)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(x,ae)|0,i=i+Math.imul(x,oe)|0,i=i+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ce)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(m,de)|0,i=i+Math.imul(m,le)|0,i=i+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(z,W),i=Math.imul(z,X),i=i+Math.imul(H,W)|0,a=Math.imul(H,X),n=n+Math.imul(N,G)|0,i=i+Math.imul(N,Q)|0,i=i+Math.imul(F,G)|0,a=a+Math.imul(F,Q)|0,n=n+Math.imul(R,J)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(B,J)|0,a=a+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,i=i+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(M,ae)|0,i=i+Math.imul(M,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(x,fe)|0,i=i+Math.imul(x,ce)|0,i=i+Math.imul(S,fe)|0,a=a+Math.imul(S,ce)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0,i=i+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,G),i=Math.imul(z,Q),i=i+Math.imul(H,G)|0,a=Math.imul(H,Q),n=n+Math.imul(N,J)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(F,J)|0,a=a+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(B,re)|0,a=a+Math.imul(B,ne)|0,n=n+Math.imul(I,ae)|0,i=i+Math.imul(I,oe)|0,i=i+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(M,fe)|0,i=i+Math.imul(M,ce)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ce)|0,n=n+Math.imul(x,de)|0,i=i+Math.imul(x,le)|0,i=i+Math.imul(S,de)|0,a=a+Math.imul(S,le)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ce=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(z,J),i=Math.imul(z,ee),i=i+Math.imul(H,J)|0,a=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(F,re)|0,a=a+Math.imul(F,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(B,ae)|0,a=a+Math.imul(B,oe)|0,n=n+Math.imul(I,fe)|0,i=i+Math.imul(I,ce)|0,i=i+Math.imul(T,fe)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(M,de)|0,i=i+Math.imul(M,le)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(x,pe)|0,i=i+Math.imul(x,be)|0,i=i+Math.imul(S,pe)|0,a=a+Math.imul(S,be)|0;var Ie=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,re),i=Math.imul(z,ne),i=i+Math.imul(H,re)|0,a=Math.imul(H,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(F,ae)|0,a=a+Math.imul(F,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ce)|0,i=i+Math.imul(B,fe)|0,a=a+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=i+Math.imul(I,le)|0,i=i+Math.imul(T,de)|0,a=a+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,i=i+Math.imul(M,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Te=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ae),i=Math.imul(z,oe),i=i+Math.imul(H,ae)|0,a=Math.imul(H,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ce)|0,i=i+Math.imul(F,fe)|0,a=a+Math.imul(F,ce)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,le)|0,i=i+Math.imul(B,de)|0,a=a+Math.imul(B,le)|0,n=n+Math.imul(I,pe)|0,i=i+Math.imul(I,be)|0,i=i+Math.imul(T,pe)|0,a=a+Math.imul(T,be)|0;var Pe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,fe),i=Math.imul(z,ce),i=i+Math.imul(H,fe)|0,a=Math.imul(H,ce),n=n+Math.imul(N,de)|0,i=i+Math.imul(N,le)|0,i=i+Math.imul(F,de)|0,a=a+Math.imul(F,le)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(B,pe)|0,a=a+Math.imul(B,be)|0;var Re=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(z,de),i=Math.imul(z,le),i=i+Math.imul(H,de)|0,a=Math.imul(H,le),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(F,pe)|0,a=a+Math.imul(F,be)|0;var Be=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,pe),i=Math.imul(z,be),i=i+Math.imul(H,pe)|0,a=Math.imul(H,be);var Oe=(c+n|0)+((8191&i)<<13)|0;return c=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=ke,f[7]=xe,f[8]=Se,f[9]=Ae,f[10]=Me,f[11]=Ee,f[12]=Ce,f[13]=Ie,f[14]=Te,f[15]=Pe,f[16]=Re,f[17]=Be,f[18]=Oe,0!==c&&(f[19]=c,r.length++),r};Math.imul||(S=c),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?S(this,e,t):r<63?c(this,e,t):r<1024?u(this,e,t):d(this,e,t)},l.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},l.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(d)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;0==(r.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var l;return l=0===t.cmpn(1)?i:o,l.cmpn(0)<0&&l.iadd(e),l},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},h.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},h.prototype.split=function(e,t){e.iushrn(this.n,0,t)},h.prototype.imulK=function(e){return e.imul(this.k)},i(p,h),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(A[e])return A[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return A[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=o;0!==h.cmp(s);){for(var b=h,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var c=t.words[n],u=f-1;u>=0;u--){var d=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(39)(e))},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27),r(28))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,f=r.iterations;o.length>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,c=o<<16|s<<8|f,u=0;u<4&&a+.75*u>>6*(3-u)&63));var d=n.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,c=s.Hasher,u=o.algo,d=[];!function(){for(var e=0;e<64;e++)d[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=u.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var c=this._hash.words,u=e[t+0],l=e[t+1],h=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],x=e[t+12],S=e[t+13],A=e[t+14],M=e[t+15],E=c[0],C=c[1],I=c[2],T=c[3];E=r(E,C,I,T,u,7,d[0]),T=r(T,E,C,I,l,12,d[1]),I=r(I,T,E,C,h,17,d[2]),C=r(C,I,T,E,p,22,d[3]),E=r(E,C,I,T,b,7,d[4]),T=r(T,E,C,I,v,12,d[5]),I=r(I,T,E,C,m,17,d[6]),C=r(C,I,T,E,g,22,d[7]),E=r(E,C,I,T,y,7,d[8]),T=r(T,E,C,I,w,12,d[9]),I=r(I,T,E,C,_,17,d[10]),C=r(C,I,T,E,k,22,d[11]),E=r(E,C,I,T,x,7,d[12]),T=r(T,E,C,I,S,12,d[13]),I=r(I,T,E,C,A,17,d[14]),C=r(C,I,T,E,M,22,d[15]),E=n(E,C,I,T,l,5,d[16]),T=n(T,E,C,I,m,9,d[17]),I=n(I,T,E,C,k,14,d[18]),C=n(C,I,T,E,u,20,d[19]),E=n(E,C,I,T,v,5,d[20]),T=n(T,E,C,I,_,9,d[21]),I=n(I,T,E,C,M,14,d[22]),C=n(C,I,T,E,b,20,d[23]),E=n(E,C,I,T,w,5,d[24]),T=n(T,E,C,I,A,9,d[25]),I=n(I,T,E,C,p,14,d[26]),C=n(C,I,T,E,y,20,d[27]),E=n(E,C,I,T,S,5,d[28]),T=n(T,E,C,I,h,9,d[29]),I=n(I,T,E,C,g,14,d[30]),C=n(C,I,T,E,x,20,d[31]),E=i(E,C,I,T,v,4,d[32]),T=i(T,E,C,I,y,11,d[33]),I=i(I,T,E,C,k,16,d[34]),C=i(C,I,T,E,A,23,d[35]),E=i(E,C,I,T,l,4,d[36]),T=i(T,E,C,I,b,11,d[37]),I=i(I,T,E,C,g,16,d[38]),C=i(C,I,T,E,_,23,d[39]),E=i(E,C,I,T,S,4,d[40]),T=i(T,E,C,I,u,11,d[41]),I=i(I,T,E,C,p,16,d[42]),C=i(C,I,T,E,m,23,d[43]),E=i(E,C,I,T,w,4,d[44]),T=i(T,E,C,I,x,11,d[45]),I=i(I,T,E,C,M,16,d[46]),C=i(C,I,T,E,h,23,d[47]),E=a(E,C,I,T,u,6,d[48]),T=a(T,E,C,I,g,10,d[49]),I=a(I,T,E,C,A,15,d[50]),C=a(C,I,T,E,v,21,d[51]),E=a(E,C,I,T,x,6,d[52]),T=a(T,E,C,I,p,10,d[53]),I=a(I,T,E,C,_,15,d[54]),C=a(C,I,T,E,l,21,d[55]),E=a(E,C,I,T,y,6,d[56]),T=a(T,E,C,I,M,10,d[57]),I=a(I,T,E,C,m,15,d[58]),C=a(C,I,T,E,S,21,d[59]),E=a(E,C,I,T,b,6,d[60]),T=a(T,E,C,I,k,10,d[61]),I=a(I,T,E,C,h,15,d[62]),C=a(C,I,T,E,w,21,d[63]),c[0]=c[0]+E|0,c[1]=c[1]+C|0,c[2]=c[2]+I|0,c[3]=c[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 a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,c=0;c<4;c++){var u=f[c];f[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=c._createHelper(l),o.HmacMD5=c._createHmacHelper(l)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TxAttrUsage=t.Transaction=void 0;var a=r(51);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(21);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(31);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=r(136),c=i(f),u=n(a),d=n(o),l=n(s),h=r(54),p=i(h),b={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){e.exports=r(141)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomArray=t.generatePrivateKey=t.generateSignature=t.getScriptHashFromAddress=t.getAddressFromScriptHash=t.getScriptHashFromPublicKey=t.getVerificationScriptFromPublicKey=t.getPublicKeyFromPrivateKey=t.getWIFFromPrivateKey=t.getPrivateKeyFromWIF=t.getPublicKeyUnencoded=t.getPublicKeyEncoded=void 0;var i=r(72),a=n(i),o=r(6),s=r(25),f=n(s),c=r(1),u=r(3),d=r(123),l=n(d),h=new o.ec("p256"),p=t.getPublicKeyEncoded=function(e){var t=(0,c.hexstring2ab)(e);return t[64]%2==1?"03"+(0,c.ab2hexstring)(t.slice(1,33)):"02"+(0,c.ab2hexstring)(t.slice(1,33))},b=(t.getPublicKeyUnencoded=function(e){return h.keyFromPublic(e,"hex").getPublic().encode("hex")},t.getPrivateKeyFromWIF=function(e){return(0,c.ab2hexstring)(a.default.decode(e,128).privateKey)},t.getWIFFromPrivateKey=function(e){return a.default.encode(128,Buffer.from(e,"hex"),!0)},t.getPublicKeyFromPrivateKey=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,c.reverseHex)((0,c.hash160)(t))},t.getAddressFromScriptHash=function(e){e=(0,c.reverseHex)(e);var t=(0,c.hash256)(u.ADDR_VERSION+e).substr(0,8);return f.default.encode(Buffer.from(u.ADDR_VERSION+e+t,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,c.ab2hexstring)(f.default.decode(e));return(0,c.reverseHex)(t.substr(2,40))},t.generateSignature=function(e,t){var r=(0,c.sha256)(e),n=Buffer.from(r,"hex"),i=new o.ec("p256"),a=i.sign(n,t,null);return Buffer.concat([a.r.toArrayLike(Buffer,"be",32),a.s.toArrayLike(Buffer,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,c.ab2hexstring)((0,l.default)(32))},t.generateRandomArray=function(e){return(0,l.default)(e)}},function(e,t){e.exports=require("crypto")},function(e,t,r){var n=r(75);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){var n=t;n.utils=r(8),n.common=r(16),n.sha=r(85),n.ripemd=r(89),n.hmac=r(90),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},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],f=r[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var u=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+f+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,c=0;c0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return f.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,u.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,u.decrypt)(this.encrypted,e,t),this._updateContractScript(),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:Symbol.toStringTag,get:function(){return"Account"}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=f.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=f.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=f.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=f.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=f.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=f.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClaimItem=t.Coin=t.AssetBalance=void 0;var n=r(1),i=(t.AssetBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{balance:e.balance?new n.Fixed8(e.balance):new n.Fixed8(0),unspent:e.unspent?e.unspent.map(function(e){return i(e)}):[],spent:e.spent?e.spent.map(function(e){return i(e)}):[],unconfirmed:e.unconfirmed?e.unconfirmed.map(function(e){return i(e)}):[]}},t.Coin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{index:e.index||0,txid:e.txid||"",value:e.value?new n.Fixed8(e.value):new n.Fixed8(0)}});t.ClaimItem=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{claim:e.claim?new n.Fixed8(e.claim):new n.Fixed8(0),txid:e.txid||"",index:e.index||0,value:e.value||0,start:e.start?new n.Fixed8(e.start):null,end:e.end?new n.Fixed8(e.end):null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(1),i=r(21),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},l=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},h=function(e){return{script:e.script||"",gas:e.gas||0}};t.serializeExclusive={2:o,128:c,209:l},t.deserializeExclusive={2:a,128:f,209:d},t.getExclusive={2:s,128:u,209:h}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(137);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(53),o=n(a),s=r(52),f=n(s),c=r(138),u=n(c),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s},function(e,t,r){"use strict";var n=r(58);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getAPIEndpoint=t.name=void 0;var i=r(22),a=n(i),o=r(7),s=r(14),f=r(17),c=r(3),u=r(1),d=r(4),l=n(d),h=(0,l.default)("api"),p=(t.name="neonDB",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}}),b=t.getBalance=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/balance/"+t).then(function(r){var n=new o.Balance({net:e,address:r.data.address});return Object.keys(r.data).map(function(e){"net"!==e&&"address"!==e&&n.addAsset(e,r.data[e])}),h.info("Retrieved Balance for "+t+" from neonDB "+e),n})},v=t.getClaims=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){var n=r.data;return n.claims=n.claims.map(function(e){return{claim:new u.Fixed8(e.claim).div(1e8),index:e.index,txid:e.txid,start:new u.Fixed8(e.start),end:new u.Fixed8(e.end),value:e.value}}),h.info("Retrieved Claims for "+t+" from neonDB "+e),new o.Claims(n)})},m=(t.getMaxClaimAmount=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){return h.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neonDB "+e),new u.Fixed8(r.data.total_claim+r.data.total_unspent_claim).div(1e8)})},t.getRPCEndpoint=function(e){var t=p(e);return a.default.get(t+"/v2/network/nodes").then(function(e){var t=e.data.nodes.filter(function(e){return e.status}),r=0,n=[],i=!0,a=!1,o=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var c=s.value;c.block_height>r?(r=c.block_height,n=[c]):c.block_height===r&&n.push(c)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})});t.getTransactionHistory=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/history/"+t).then(function(r){return h.info("Retrieved History for "+t+" from neonDB "+e),r.data.history})},t.getWalletDBHeight=function(e){var t=p(e);return a.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){h.warn("doClaimAllGas will be deprecated in favor of claimGas");var n=new o.Account(t),i=m(e),a=v(e,n.address),c=void 0,u=void 0;return Promise.all([i,a]).then(function(e){u=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=s.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return c=e,f.Query.sendRawTransaction(c).execute(u)}).then(function(e){return!0===e.result?e.txid=c:h.error("Transaction failed: "+c.serialize()),e})},t.doMintTokens=function(e,t,r,n,i,a){h.warn("doMintTokens will be deprecated in favor of doInvoke");var d=new o.Account(r),l=[{assetId:c.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t,args:[]},v=m(e),g=b(e,d.address),y=void 0,w=void 0;return Promise.all([v,g]).then(function(e){w=e[0];var r=e[1],n=[{data:(0,u.reverseHex)(t),usage:s.TxAttrUsage.Script}],o=s.Transaction.createInvocationTx(r,l,p,i,{attributes:n});return a?a(o,d.publicKey):o.sign(d.privateKey)}).then(function(e){return y=e,f.Query.getContractState(t).execute(w)}).then(function(e){var t={invocationScript:"0000",verificationScript:e.result.script};return y.scripts.unshift(t),f.Query.sendRawTransaction(y).execute(w)}).then(function(e){return!0===e.result?e.txid=y.hash:h.error("Transaction failed: "+y.serialize()),e})},t.doSendAsset=function(e,t,r,n,i){h.warn("doSendAsset will be deprecated in favor of sendAsset");var a=new o.Account(r),u=new o.Account(t),d=m(e),l=b(e,a.address),p=Object.keys(n).map(function(e){return{assetId:c.ASSET_ID[e],value:n[e],scriptHash:u.scriptHash}}),v=void 0,g=void 0;return Promise.all([d,l]).then(function(e){g=e[0];var t=e[1],r=s.Transaction.createContractTx(t,p);return i?i(r,a.publicKey):r.sign(a.privateKey)}).then(function(e){return v=e,f.Query.sendRawTransaction(v).execute(g)}).then(function(e){return!0===e.result?e.txid=v.hash:h.error("Transaction failed: "+v.serialize()),e})}},function(e,t,r){"use strict";function n(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}var i=r(73),a=r(74);e.exports=a(n)},function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=r(38),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t){e.exports=require("buffer")},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function u(e){return l(e,17)^l(e,19)^e>>>10}var d=r(8),l=d.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=c,t.g1_256=u},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(8),a=r(16),o=r(41),s=r(10),f=i.sum32,c=i.sum32_4,u=i.sum32_5,d=o.ch32,l=o.maj32,h=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[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];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=b+c[h-7]+m+c[h-16]}var g=s&u^~s&d,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=l+_+g+f[h]+c[h],x=w+y;l=d,d=u,u=s,s=o+k|0,o=a,a=i,i=n,n=k+x|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+l|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 e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(u),r.HmacSHA256=a._createHmacHelper(u)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,c=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=t()}();var d=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],d=r[6],l=r[7],h=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,k=s.low,x=f.high,S=f.low,A=d.high,M=d.low,E=l.high,C=l.low,I=h,T=p,P=b,R=v,B=m,O=g,N=y,F=w,j=_,z=k,H=x,q=S,L=A,D=M,U=E,K=C,V=0;V<80;V++){var Y=u[V];if(V<16)var W=Y.high=0|e[t+2*V],X=Y.low=0|e[t+2*V+1];else{var Z=u[V-15],G=Z.high,Q=Z.low,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=u[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,fe=u[V-16],ce=fe.high,ue=fe.low,X=J+se,W=$+oe+(X>>>0>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ue,W=W+ce+(X>>>0>>0?1:0);Y.high=W,Y.low=X}var de=j&H^~j&L,le=z&q^~z&D,he=I&P^I&B^P&B,pe=T&R^T&O^R&O,be=(I>>>28|T<<4)^(I<<30|T>>>2)^(I<<25|T>>>7),ve=(T>>>28|I<<4)^(T<<30|I>>>2)^(T<<25|I>>>7),me=(j>>>14|z<<18)^(j>>>18|z<<14)^(j<<23|z>>>9),ge=(z>>>14|j<<18)^(z>>>18|j<<14)^(z<<23|j>>>9),ye=c[V],we=ye.high,_e=ye.low,ke=K+ge,xe=U+me+(ke>>>0>>0?1:0),ke=ke+le,xe=xe+de+(ke>>>0>>0?1:0),ke=ke+_e,xe=xe+we+(ke>>>0<_e>>>0?1:0),ke=ke+X,xe=xe+W+(ke>>>0>>0?1:0),Se=ve+pe,Ae=be+he+(Se>>>0>>0?1:0);U=L,K=D,L=H,D=q,H=j,q=z,z=F+ke|0,j=N+xe+(z>>>0>>0?1:0)|0,N=B,F=O,B=P,O=R,P=I,R=T,T=ke+Se|0,I=xe+Ae+(T>>>0>>0?1:0)|0}p=n.low=p+T,n.high=h+I+(p>>>0>>0?1:0),v=i.low=v+R,i.high=b+P+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+B+(g>>>0>>0?1:0),w=o.low=w+F,o.high=y+N+(w>>>0>>0?1:0),k=s.low=k+z,s.high=_+j+(k>>>0>>0?1:0),S=f.low=S+q,f.high=x+H+(S>>>0>>0?1:0),M=d.low=M+D,d.high=A+L+(M>>>0>>0?1:0),C=l.low=C+K,l.high=E+U+(C>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(d),r.HmacSHA512=i._createHmacHelper(d)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(25),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(1),o=r(23);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptAsync=t.decrypt=t.encryptAsync=t.encrypt=void 0;var i=r(36),a=n(i),o=r(44),s=r(124),f=n(s),c=r(132),u=n(c),d=r(29),l=n(d),h=r(1),p=r(3),b=r(4),v=n(b),m=(0,v.default)("wallet");m.warn("ScryptParams will be changing to use n,r,p in place of cost, blockSize, parallel. New standard will be preferred. DEFAULT_SCRYPT will use new standard upon major version bump.");var g=(t.encrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;r=g(r);var n={cost:r.n,blockSize:r.r,parallel:r.p},i=new l.default(e),s=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(i.address))).toString().slice(0,8),c=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(s,"hex"),n).toString("hex"),u=c.slice(0,64),d=c.slice(64),b=(0,h.hexXor)(i.privateKey,u),v=o.AES.encrypt(o.enc.Hex.parse(b),o.enc.Hex.parse(d),{mode:o.mode.ECB,padding:o.pad.NoPadding}),y=p.NEP_HEADER+p.NEP_FLAG+s+v.ciphertext.toString(),w=a.default.encode(Buffer.from(y,"hex"));return m.info("Successfully encrypted key to "+w),w},t.encryptAsync=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(n,i){r=g(r);var s=r,f=s.n,c=s.r,d=s.p,b=new l.default(e),v=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(b.address))).toString().slice(0,8);(0,u.default)(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(v,"hex"),f,c,d,64,function(e,t,r){if(null!=e)i(e);else if(r){var s=Buffer.from(r).toString("hex"),f=s.slice(0,64),c=s.slice(64),u=(0,h.hexXor)(b.privateKey,f),d=o.AES.encrypt(o.enc.Hex.parse(u),o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),l=p.NEP_HEADER+p.NEP_FLAG+v+d.ciphertext.toString(),g=a.default.encode(Buffer.from(l,"hex"));m.info("Successfully encrypted key to "+g),n(g)}})})},t.decrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;r=g(r);var n={cost:r.n,blockSize:r.r,parallel:r.p},i=(0,h.ab2hexstring)(a.default.decode(e)),s=i.substr(6,8),c=i.substr(-64),u=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(s,"hex"),n).toString("hex"),d=u.slice(0,64),b=u.slice(64),v={ciphertext:o.enc.Hex.parse(c),salt:""},y=o.AES.decrypt(v,o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),w=(0,h.hexXor)(y.toString(),d),_=new l.default(w);if(s!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(_.address))).toString().slice(0,8))throw new Error("Wrong Password!");return m.info("Successfully decrypted "+e),_.WIF},t.decryptAsync=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(n,i){r=g(r);var s=r,f=s.n,c=s.r,d=s.p,p=(0,h.ab2hexstring)(a.default.decode(e)),b=p.substr(6,8),v=p.substr(-64);(0,u.default)(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(b,"hex"),f,c,d,64,function(t,r,a){if(null!=t)i(t);else if(a){var s=Buffer.from(a).toString("hex"),f=s.slice(0,64),c=s.slice(64),u={ciphertext:o.enc.Hex.parse(v),salt:""},d=o.AES.decrypt(u,o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),p=(0,h.hexXor)(d.toString(),f),g=new l.default(p),y=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8);if(b!==y)throw new Error("Wrong Password!");m.info("Successfully decrypted "+e),n(g.WIF)}})})},function(e){var t=Object.assign({},p.DEFAULT_SCRYPT,e);return{n:t.n||t.cost,r:t.r||t.blockSize,p:t.p||t.parallel}})},function(e,t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?Buffer("","utf8"):e instanceof Buffer?e:"string"==typeof e?new Buffer(e,"utf8"):new Buffer(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:c(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function c(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r},function(e,t){e.exports=require("fs")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(1),i=r(7),a=r(31),o=r(3),s=r(21),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),c=r(4),u=function(e){return e&&e.__esModule?e:{default:e}}(c),d=(0,u.default)("tx"),l=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var i=t.reduce(function(e,t){return e[t.assetId]?e[t.assetId]=e[t.assetId].add(t.value):e[t.assetId]=t.value,e},{});return r=new n.Fixed8(r),r.gt(0)&&(i[o.ASSET_ID.GAS]?i[o.ASSET_ID.GAS]=i[o.ASSET_ID.GAS].add(r):i[o.ASSET_ID.GAS]=r),Object.keys(i).map(function(t){var r=i[t],n=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(n))throw new Error("This balance does not contain any "+n+"!");var a=e.assets[n];if(a.balance.lt(r))throw new Error("Insufficient "+o.ASSETS[t]+"! Need "+r.toString()+" but only found "+a.balance.toString());return l(a,r,t,e.address)}).reduce(function(e,t){return{inputs:e.inputs.concat(t.inputs),change:e.change.concat(t.change)}},{inputs:[],change:[]})},function(e,t,r,a){e.unspent.sort(function(e,t){return e.value.sub(t.value)});for(var s=0,f=new n.Fixed8(0);f.lt(t);){if((s+=1)>e.unspent.length)throw new Error("Insufficient "+o.ASSETS[r]+"! Reached end of unspent coins! "+e.unspent.length);f=f.add(e.unspent[s-1].value)}var c=[];return f.gt(t)&&c.push({assetId:r,value:f.sub(t),scriptHash:(0,i.getScriptHashFromAddress)(a)}),{inputs:e.unspent.slice(0,s).map(function(e){return{prevHash:e.txid,prevIndex:e.index}}),change:c}}),h=t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var c,u=e.attributes[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value;r+=f.serializeTransactionAttribute(d)}}catch(e){o=!0,s=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var l=!0,h=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(l=(b=v.next()).done);l=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){h=!0,p=e}finally{try{!l&&v.return&&v.return()}finally{if(h)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,k=e.outputs[Symbol.iterator]();!(g=(_=k.next()).done);g=!0){var x=_.value;r+=f.serializeTransactionOutput(x)}}catch(e){y=!0,w=e}finally{try{!g&&k.return&&k.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var S=!0,A=!1,M=void 0;try{for(var E,C=e.scripts[Symbol.iterator]();!(S=(E=C.next()).done);S=!0){var I=E.value;r+=f.serializeWitness(I)}}catch(e){A=!0,M=e}finally{try{!S&&C.return&&C.return()}finally{if(A)throw M}}}return r};t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]&&arguments[1];if((0,f.ensureHex)(e),40!==e.length)throw new Error("ScriptHash should be 20 bytes long!");return this.emit(t?u.default.TAILCALL:u.default.APPCALL,(0,f.reverseHex)(e))}},{key:"_emitArray",value:function(e){for(var t=e.length-1;t>=0;t--)this.emitPush(e[t]);return this.emitPush(e.length).emit(u.default.PACK)}},{key:"_emitString",value:function(e){(0,f.ensureHex)(e);var t=e.length/2;return t<=u.default.PUSHBYTES75?(this.str+=(0,f.num2hexstring)(t),this.str+=e):t<256?(this.emit(u.default.PUSHDATA1),this.str+=(0,f.num2hexstring)(t),this.str+=e):t<65536?(this.emit(u.default.PUSHDATA2),this.str+=(0,f.num2hexstring)(t,2),this.str+=e):(this.emit(u.default.PUSHDATA4),this.str+=(0,f.num2hexstring)(t,4),this.str+=e),this}},{key:"_emitNum",value:function(e){if(-1===e)return this.emit(u.default.PUSHM1);if(0===e)return this.emit(u.default.PUSH0);if(e>0&&e<=16)return this.emit(u.default.PUSH1-1+e);var t=(0,f.int2hex)(e);return this.emitPush((0,f.reverseHex)("0".repeat(16-t.length)+t))}},{key:"_emitParam",value:function(e){if(!e.type)throw new Error("No type available!");if(!l(e.value))throw new Error("Invalid value provided!");switch(e.type){case"String":return this._emitString((0,f.str2hexstring)(e.value));case"Boolean":return this.emit(e.value?u.default.PUSHT:u.default.PUSHF);case"Integer":return this._emitNum(e.value);case"ByteArray":return this._emitString(e.value);case"Array":return this._emitArray(e.value);case"Hash160":return this._emitString((0,f.reverseHex)(e.value))}}},{key:"emit",value:function(e,t){return this.str+=(0,f.num2hexstring)(e),t&&(this.str+=t),this}},{key:"emitAppCall",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.emitPush(r),t){for(var i="",a=0;a1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBlockHash",value:function(t){return new e({method:"getblockhash",params:[t]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;a=300&&e.statusCode<400){if(++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new Error("Max redirects exceeded."));var r,n=this._options.headers;if(307!==e.statusCode&&!(this._options.method in d)){this._options.method="GET",this._requestBodyBuffers=[];for(r in n)/^content-/i.test(r)&&delete n[r]}if(!this._isRedirect)for(r in n)/^host$/i.test(r)&&delete n[r];var i=a.resolve(this._currentUrl,t);u("redirecting to",i),Object.assign(this._options,a.parse(i)),this._isRedirect=!0,this._performRequest()}else e.responseUrl=this._currentUrl,this.emit("response",e),delete this._options,delete this._requestBodyBuffers},n.prototype.abort=function(){this._currentRequest.abort()},n.prototype.flushHeaders=function(){this._currentRequest.flushHeaders()},n.prototype.setNoDelay=function(e){this._currentRequest.setNoDelay(e)},n.prototype.setSocketKeepAlive=function(e,t){this._currentRequest.setSocketKeepAlive(e,t)},n.prototype.setTimeout=function(e,t){this._currentRequest.setTimeout(e,t)},n.prototype.write=function(e,t,r){this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new Error("Request body larger than maxBodyLength limit")),this.abort())},n.prototype.end=function(e,t,r){var n=this._currentRequest;e?this.write(e,t,function(){n.end(null,null,r)}):n.end(null,null,r)},e.exports=i({http:o,https:s}),e.exports.wrap=i},function(e,t){e.exports=require("url")},function(e,t,r){function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){function r(){if(r.enabled){var e=r,n=+new Date,a=n-(i||n);e.diff=a,e.prev=i,e.curr=n,i=n;for(var o=new Array(arguments.length),s=0;s=0&&e<=1&&(d=e)},t.setSwitchFreeze=function(e){l=!!e,u.info("core/setSwitchFreeze API switch is frozen: "+l)},function(){!l&&d>0&&(d-=.2,u.info("core API Switch increasing weight towards neoscan"))}),p=function(){!l&&d<1&&(d+=.2,u.info("core API Switch increasing weight towards neonDB"))};t.loadBalance=function(e,t){return Math.random()>d?e(t,s).then(function(e){return h(),e}).catch(function(){return p(),e(t,a)}):e(t,a).then(function(e){return p(),e}).catch(function(){return h(),e(t,s)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHistory=t.getWalletDBHeight=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getRPCEndpoint=t.getAPIEndpoint=t.name=void 0;var i=r(22),a=n(i),o=r(7),s=r(3),f=r(1),c=r(4),u=n(c),d=(0,u.default)("api"),l=(t.name="neoscan",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"https://api.neoscan.io/api/main_net";case"TestNet":return"https://neoscan-testnet.io/api/test_net";default:return e}}),h=(t.getRPCEndpoint=function(e){var t=l(e);return a.default.get(t+"/v1/get_all_nodes").then(function(t){var r=t.data,n=0,i=[],a=!0,o=!1,s=void 0;try{for(var f,c=r[Symbol.iterator]();!(a=(f=c.next()).done);a=!0){var u=f.value;u.height>n?(n=u.height,i=[u]):u.height===n&&i.push(u)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}var l=i[Math.floor(Math.random()*i.length)].url;return d.info("Best node from neoscan "+e+": "+l),l})},t.getBalance=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_balance/"+t).then(function(r){if(r.data.address!==t&&null===r.data.balance)return new o.Balance({address:r.data.address});var n=new o.Balance({address:r.data.address,net:e});return r.data.balance.map(function(e){n.addAsset(e.asset,{balance:e.amount,unspent:h(e.unspent)})}),d.info("Retrieved Balance for "+t+" from neoscan "+e),n})},t.getClaims=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){if(r.address!==t&&null===r.data.claimable)return new o.Claims({address:r.data.address});var n=p(r.data.claimable);return d.info("Retrieved Balance for "+t+" from neoscan "+e),new o.Claims({net:e,address:r.data.address,claims:n})})},t.getMaxClaimAmount=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){return d.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neoscan "+e),new f.Fixed8(r.data.unclaimed||0)})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),p=function(e){return e.map(function(e){return{start:new f.Fixed8(e.start_height),end:new f.Fixed8(e.end_height),index:e.n,claim:new f.Fixed8(e.unclaimed),txid:e.txid,value:e.value}})},b=(t.getWalletDBHeight=function(e){var t=l(e);return a.default.get(t+"/v1/get_height").then(function(e){return parseInt(e.data.height)})},t.getTransactionHistory=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_address_neon/"+t).then(function(r){return d.info("Retrieved History for "+t+" from neoscan "+e),b(r.data.txids)})},function(e){return e.map(function(e){var t=e.txid,r=e.block_height,n=e.balance,i=e.asset_moved,a=!1,o=!1,f=s.ASSETS.GAS,c=s.ASSETS.NEO;return n.forEach(function(e){var t=e.asset,r=e.amount;t===f&&(f=r),t===c&&(c=r)}),s.ASSET_ID.GAS===i&&(a=!0),s.ASSET_ID.NEO===i&&(o=!0),{GAS:f,NEO:c,block_index:r,gas_sent:a,neo_sent:o,txid:t}})})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.logging=t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(70),a=n(i),o=r(17),s=n(o),f=r(3),c=n(f),u=r(32),d=n(u),l=r(14),h=n(l),p=r(7),b=n(p),v=r(1),m=n(v),g=r(4),y=n(g),w=[d.default,h.default,b.default,a.default,s.default],_=w.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:c,u:m});t.default=_,t.api=a,t.rpc=s,t.sc=d,t.tx=h,t.wallet=b,t.u=m,t.CONST=c,t.logging=y},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(71);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(67);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(35),s=n(o),f=r(171),c=n(f),u=r(172),d=n(u),l=r(68),h=n(l),p=n(i);t.default={get:{price:c.getPrice,prices:c.getPrices,balance:s.getBalance,claims:s.getClaims,transactionHistory:s.getTransactionHistory,tokenBalance:d.getTokenBalance,tokenInfo:d.getTokenInfo,token:d.getToken},do:{sendAsset:s.doSendAsset,claimAllGas:s.doClaimAllGas,mintTokens:s.doMintTokens},sendAsset:function(e){return p.sendAsset(e)},claimGas:function(e){return p.claimGas(e)},doInvoke:function(e){return p.doInvoke(e)}},t.neonDB=s,t.cmc=c,t.nep5=d,t.neoscan=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxClaimAmountFrom=t.getWalletDBHeightFrom=t.getTransactionHistoryFrom=t.getRPCEndpointFrom=t.getClaimsFrom=t.getBalanceFrom=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.fillKeys=t.fillBalance=t.fillUrl=t.doInvoke=t.claimGas=t.sendAsset=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(7),a=r(3),o=r(17),s=r(14),f=r(1),c=r(67),u=r(4),d=function(e){return e&&e.__esModule?e:{default:e}}(u),l=(0,d.default)("api"),h=(t.sendAsset=function(e){return h(e).then(b).then(p).then(function(e){return v(e,"contract")}).then(function(e){return _(e)}).then(function(e){return m(e)}).then(function(e){return k(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,tx:e.tx};throw l.error("sendAsset failed with: "+t.message+". Dumping config",r),t})},t.claimGas=function(e){return h(e).then(b).then(function(t){return(0,c.loadBalance)(A,e)}).then(function(e){return v(e,"claim")}).then(function(e){return m(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,claims:e.claims,tx:e.tx};throw l.error("claimGas failed with "+t.message+". Dumping config",r),t})},t.doInvoke=function(e){return h(e).then(b).then(p).then(function(e){return v(e,"invocation")}).then(function(e){return _(e)}).then(function(e){return y(e)}).then(function(e){return m(e)}).then(function(e){return w(e)}).then(function(e){return k(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,script:e.script,gas:e.gas,tx:e.tx};throw l.error("doInvoke failed with "+t.message+". Dumping config",r),t})},t.fillUrl=function(e){return e.url?Promise.resolve(e):(0,c.loadBalance)(M,e).then(function(t){return Object.assign(e,{url:t})})}),p=t.fillBalance=function(e){return e.balance?Promise.resolve(e):(0,c.loadBalance)(S,e)},b=t.fillKeys=function(e){return e.account&&(e.address||(e.address=e.account.address),e.privateKey||e.signingFunction||(e.privateKey=e.account.privateKey),!e.publicKey&&e.signingFunction&&(e.publicKey=e.account.publicKey)),Promise.resolve(e)},v=t.createTx=function(e,t){if(e.tx)return e;"string"==typeof t&&(t=t.toLowerCase());var r=void 0;switch(t){case"claim":case 2:x(e,"claims"),r=s.Transaction.createClaimTx(e.address,e.claims);break;case"contract":case 128:x(e,"balance","intents"),r=s.Transaction.createContractTx(e.balance,e.intents,e.override);break;case"invocation":case 209:x(e,"balance","gas","script"),e.intents||(e.intents=[]),r=s.Transaction.createInvocationTx(e.balance,e.intents,e.script,e.gas,e.override);break;default:return Promise.reject(new Error("Tx Type not found: "+t))}return Promise.resolve(Object.assign(e,{tx:r}))},m=t.signTx=function(e){x(e,"tx");var t=void 0;if(e.signingFunction){var r=new i.Account(e.publicKey);t=e.signingFunction(e.tx,r.publicKey).then(function(e){return"string"==typeof e&&(e=s.Transaction.deserialize(e)),e})}else{if(!e.privateKey)return Promise.reject(new Error("Needs privateKey or signingFunction to sign!"));var n=new i.Account(e.privateKey);if(e.address!==n.address&&!e.sendingFromSmartContract)return Promise.reject(new Error("Private Key and Balance address does not match!"));t=Promise.resolve(e.tx.sign(n.privateKey))}return t.then(function(t){return Object.assign(e,{tx:t})})},g=t.sendTx=function(e){return x(e,"tx","url"),o.Query.sendRawTransaction(e.tx).execute(e.url).then(function(t){if(!0===t.result)t.txid=e.tx.hash,e.balance&&e.balance.applyTx(e.tx,!1);else{var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,claims:e.claims,script:e.script,gas:e.gas,tx:e.tx};l.error("Transaction failed for "+e.address+": "+e.tx.serialize(),r)}return Object.assign(e,{response:t})})},y=(t.makeIntent=function(e,t){var r=new i.Account(t);return Object.keys(e).map(function(t){return(0,s.TransactionOutput)({assetId:a.ASSET_ID[t],value:e[t],scriptHash:r.scriptHash})})},function(e){return e.override||(e.override={}),"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash&&e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(e.script.scriptHash)),Promise.resolve(e)}),w=function(e){return"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash?o.Query.getContractState(e.script.scriptHash).execute(e.url).then(function(t){var r={invocationScript:"0000",verificationScript:t.result.script};return e.tx.scripts.push(r),e}):Promise.resolve(e)},_=function(e){if(e.override||(e.override={}),e.sendingFromSmartContract){var t=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(t.scriptHash))}return Promise.resolve(e)},k=function(e){if(e.sendingFromSmartContract){var t=(0,i.getScriptHashFromAddress)(e.address);return o.Query.getContractState(t).execute(e.url).then(function(r){var n=r.result,a=n.parameters,o=n.script,s={invocationScript:"00".repeat(a.length),verificationScript:o},f=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);return parseInt(t,16)>parseInt(f.scriptHash,16)?e.tx.scripts.push(s):e.tx.scripts.unshift(s),e})}return Promise.resolve(e)},x=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0;)r.push(a%o),a=a/o|0}for(var f="",c=0;0===t[c]&&c=0;--u)f+=e[r[u]];return f}function r(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.allocUnsafe(0);for(var t=[0],r=0;r>=8;for(;c>0;)t.push(255&c),c>>=8}for(var u=0;e[u]===s&&u=0;){var a;if(i.isOdd()){var o=i.andln(n-1);a=o>(n>>1)-1?(n>>1)-o:o,i.isubn(a)}else a=0;r.push(a);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,o=t.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var f=e.andln(7)+n&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var c;if(0==(1&o))c=0;else{var f=t.andln(7)+i&7;c=3!==f&&5!==f||2!==a?o:-o}r[1].push(c),2*n===s+1&&(n=1-n),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function a(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function o(e){return"string"==typeof e?f.toArray(e,"hex"):e}function s(e){return new c(e,"hex","le")}var f=t,c=r(9),u=r(10),d=r(40);f.assert=u,f.toArray=d.toArray,f.zero2=d.zero2,f.toHex=d.toHex,f.encode=d.encode,f.getNAF=n,f.getJSF=i,f.cachedProperty=a,f.parseBytes=o,f.intFromLE=s},function(e,t,r){function n(e){this.rand=e}var i;if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,t){this.curve=e,this.type=t,this.precomputed=null}var a=r(9),o=r(6),s=o.utils,f=s.getNAF,c=s.getJSF,u=s.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(e,t){u(e.precomputed);var r=e._getDoubles(),n=f(t,1),i=(1<=o;t--)s=(s<<1)+n[t];a.push(s)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(var o=0;o=0;s--){for(var t=0;s>=0&&0===a[s];s--)t++;if(s>=0&&t++,o=o.dblp(t),s<0)break;var c=a[s];u(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},n.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,u=0,d=0;d=1;d-=2){var p=d-1,b=d;if(1===a[p]&&1===a[b]){var v=[t[p],null,null,t[b]];0===t[p].y.cmp(t[b].y)?(v[1]=t[p].add(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg())):0===t[p].y.cmp(t[b].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].add(t[b].neg())):(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=c(r[p],r[b]);u=Math.max(g[0].length,u),s[p]=new Array(u),s[b]=new Array(u);for(var y=0;y=0;d--){for(var S=0;d>=0;){for(var A=!0,y=0;y=0&&S++,k=k.dblp(S),d<0)break;for(var y=0;y0?l=o[y][M-1>>1]:M<0&&(l=o[y][-M-1>>1].neg()),k="affine"===l.type?k.mixedAdd(l):k.add(l))}}for(var d=0;d=Math.ceil((e.bitLength()+1)/t.step)},i.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},n.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),f=i.mul(r.b),c=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:f.add(c).neg()}},n.prototype.pointFromX=function(e,t){e=new f(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.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(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},n.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(e){return e=new f(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},i.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},i.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},c(a,u.BasePoint),n.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),d=n.redMul(c),l=f.redSqr().redIAdd(u).redISub(d).redISub(d),h=f.redMul(d.redISub(l)).redISub(a.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),c=f.redMul(o),u=r.redMul(f),d=s.redSqr().redIAdd(c).redISub(u).redISub(u),l=s.redMul(u.redISub(d)).redISub(i.redMul(c)),h=this.z.redMul(o);return this.curve.jpoint(d,l,h)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";function n(e){f.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,t,r){f.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(t,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(18),o=r(9),s=r(19),f=a.base,c=r(6),u=c.utils;s(n,f),e.exports=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},s(i,f.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(u.toArray(e,t),1)},n.prototype.point=function(e,t){return new i(this,e,t)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,t){return new i(e,t[0],t[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=t.redSub(n),a=t.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(r),s=i.redMul(n),f=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,c)},i.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";function n(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,c.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function i(e,t,r,n,i){c.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(18),o=r(6),s=r(9),f=r(19),c=a.base,u=o.utils.assert;f(n,c),e.exports=n,n.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},n.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},n.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},n.prototype.pointFromX=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o)},n.prototype.pointFromY=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},n.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},f(i,c.BasePoint),n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},n.prototype.point=function(e,t,r,n){return new i(this,e,t,r,n)},i.fromJSON=function(e,t){return new i(e,t[0],t[1],t[2])},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),f=i.redMul(o),c=a.redMul(s),u=i.redMul(s),d=o.redMul(a);return this.curve.point(f,c,d,u)},i.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),s=o.redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),c=s.redSub(f).redISub(f);e=n.redSub(i).redISub(a).redMul(c),t=s.redMul(o.redSub(a)),r=s.redMul(c)}}else{var o=i.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=o.redSub(f).redSub(f);e=this.curve._mulC(n.redISub(o)).redMul(c),t=this.curve._mulC(o).redMul(i.redISub(a)),r=o.redMul(c)}return this.curve.point(e,t,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),c=a.redMul(o),u=s.redMul(f),d=a.redMul(f),l=o.redMul(s);return this.curve.point(c,u,l,d)},i.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),f=i.redSub(s),c=i.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=n.redMul(f).redMul(u);return this.curve.twisted?(t=n.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(c)):(t=n.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(d,t,r)},i.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},i.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},i.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},i.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},function(e,t,r){"use strict";function n(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new n(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}var a=t,o=r(26),s=r(6),f=s.utils.assert;a.PresetCurve=n,i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]});var c;try{c=r(91)}catch(e){c=void 0}i("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",c]})},function(e,t,r){"use strict";t.sha1=r(86),t.sha224=r(87),t.sha256=r(42),t.sha384=r(88),t.sha512=r(43)},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var i=r(8),a=r(16),o=r(41),s=i.rotl32,f=i.sum32,c=i.sum32_5,u=o.ft_1,d=a.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];i.inherits(n,d),e.exports=n,n.blockSize=512,n.outSize=160,n.hmacStrength=80,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},n.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},n.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),f=e.toArray("be",o),c=new a({hash:this.hash,entropy:s,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new i(1)),l=0;!0;l++){var h=n.k?n.k(l):new i(c.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(d)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var m=h.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(m=m.umod(this.n),0!==m.cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new u({r:v,s:m,recoveryParam:g})}}}}}},n.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n),t=new u(t,"hex");var a=t.r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(e).umod(this.n),c=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var d=this.g.mulAdd(f,r.getPublic(),c);return!d.isInfinity()&&0===d.getX().umod(this.n).cmp(a)}var d=this.g.jmulAdd(f,r.getPublic(),c);return!d.isInfinity()&&d.eqXToP(a)},n.prototype.recoverPubKey=function(e,t,r,n){f((3&r)===r,"The recovery param is more than two bits"),t=new u(t,n);var a=this.n,o=new i(e),s=t.r,c=t.s,d=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var h=t.r.invm(a),p=a.sub(o).mul(h).umod(a),b=c.mul(h).umod(a);return this.g.mulAdd(p,s,b)},n.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new u(t,n),null!==t.recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var i=r(26),a=r(40),o=r(10);e.exports=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},n.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"}},function(e,t,r){"use strict";function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(d(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function i(){this.place=0}function a(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}var f=r(9),c=r(6),u=c.utils,d=u.assert;e.exports=n,n.prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new i;if(48!==e[r.place++])return!1;if(a(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=a(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=a(e,r);if(e.length!==s+r.place)return!1;var c=e.slice(r.place,s+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new f(o),this.s=new f(c),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,t.length),n=n.concat(t),n.push(2),s(n,r.length);var i=n.concat(r),a=[48];return s(a,i.length),a=a.concat(i),u.encode(a,e)}},function(e,t,r){"use strict";function n(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof n))return new n(e);var e=a.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}var i=r(26),a=r(6),o=a.utils,s=o.assert,f=o.parseBytes,c=r(97),u=r(98);e.exports=n,n.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},n.prototype.verify=function(e,t,r){e=f(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},n.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>>2]|=e[n]<<24-n%4*8;i.call(this,r,t)}else i.apply(this,arguments)}).prototype=n}}(),e.lib.WordArray})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return i.create(r,2*t)}};a.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],a=0;a>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a>>1]|=t(e.charCodeAt(a)<<16-a%2*16);return i.create(n,2*r)}}}(),e.enc.Utf16})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(45))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=t.algo,a=i.SHA256,o=i.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=a._createHelper(o),t.HmacSHA224=a._createHmacHelper(o)}(),e.SHA224})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20),r(46))}(0,function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),e.SHA384})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64,s=o.Word,f=r.algo,c=[],u=[],d=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,o=0;o<24;o++){for(var f=0,l=0,h=0;h<7;h++){if(1&a){var p=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=r[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var h=0;h<5;h++){for(var p=0,b=0,v=0;v<5;v++){var s=r[h+5*v];p^=s.high,b^=s.low}var m=l[h];m.high=p,m.low=b}for(var h=0;h<5;h++)for(var g=l[(h+4)%5],y=l[(h+1)%5],w=y.high,_=y.low,p=g.high^(w<<1|_>>>31),b=g.low^(_<<1|w>>>31),v=0;v<5;v++){var s=r[h+5*v];s.high^=p,s.low^=b}for(var k=1;k<25;k++){var s=r[k],x=s.high,S=s.low,A=c[k];if(A<32)var p=x<>>32-A,b=S<>>32-A;else var p=S<>>64-A,b=x<>>64-A;var M=l[u[k]];M.high=p,M.low=b}var E=l[0],C=r[0];E.high=C.high,E.low=C.low;for(var h=0;h<5;h++)for(var v=0;v<5;v++){var k=h+5*v,s=r[k],I=l[k],T=l[(h+1)%5+5*v],P=l[(h+2)%5+5*v];s.high=I.high^~T.high&P.high,s.low=I.low^~T.low&P.low}var s=r[0],R=d[f];s.high^=R.high,s.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,f=s/8,c=[],u=0;u>>24)|4278255360&(l<<24|l>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),c.push(h),c.push(l)}return new i.init(c,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(h),r.HmacSHA3=a._createHmacHelper(h)}(Math),e.SHA3})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){/** @preserve +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=69)}([function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var c=f*a,u=e.min(4*c,i);if(c){for(var d=0;d1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(t%1!=0)throw new Error("size must be a whole integer");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");t*=2;var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=w(n)),n}),w=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;if("number"!=typeof e)throw new Error("num must be numeric");if(t%1!=0)throw new Error("size must be a whole integer");return new S(e.toFixed(8)).toReverseHex().slice(0,2*t)},t.fixed82num=function(e){return x(e),""===e?0:S.fromReverseHex(e).toNumber()},t.num2VarInt=function(e){return e<253?y(e):e<=65535?"fd"+y(e,2,!0):e<=4294967295?"fe"+y(e,4,!0):"ff"+y(e,8,!0)},t.hexXor=function(e,t){if(x(e),x(t),e.length!==t.length)throw new Error("strings are disparate lengths");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t}),_=/^([0-9A-Fa-f]{2})*$/,k=t.isHex=function(e){try{return _.test(e)}catch(e){return!1}},x=t.ensureHex=function(e){if(!k(e))throw new Error("Expected a hexstring but got "+e)},S=(t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.str=t,this.pter=0}return f(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(w(this.read(2)),16):254===e?e=parseInt(w(this.read(4)),16):255===e&&(e=parseInt(w(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e),r=(0,u.SHA256)(t);return(0,u.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e),r=(0,u.SHA256)(t);return(0,u.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=u.enc.Hex.parse(e);return(0,u.SHA256)(t).toString()},t.Fixed8=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return o(this,t),"number"==typeof e&&(e=e.toFixed(8)),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return a(t,e),f(t,[{key:"toHex",value:function(){var e=this.mul(1e8).round().toString(16);return"0".repeat(16-e.length)+e}},{key:"toReverseHex",value:function(){return w(this.toHex())}},{key:p.default.inspect.custom,value:function(e,t){return this.toFixed(8)}},{key:"ceil",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ceil",this).call(this))}},{key:"floor",value:function(){return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"floor",this).call(this))}},{key:"round",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"round",this).call(this,e,r))}},{key:"div",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.dividedBy(e,t)}},{key:"dividedBy",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dividedBy",this).call(this,e,r))}},{key:"mul",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.times(e,t)}},{key:"times",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"times",this).call(this,e,r))}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.plus(e,t)}},{key:"plus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"plus",this).call(this,e,r))}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.minus(e,t)}},{key:"minus",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"minus",this).call(this,e,r))}}],[{key:"fromHex",value:function(e){return new t(e,16).div(1e8)}},{key:"fromReverseHex",value:function(e){return this.fromHex(w(e))}}]),t}(l.default))},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(11))}(0,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc,f=(s.Utf8,s.Base64),c=r.algo,u=c.EvpKDF,d=n.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?x:w}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),l=(n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),h=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=l.CBC=function(){function e(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else var a=this._prevBlock;for(var o=0;o>>2];e.sigBytes-=t}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:v}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=r.format={},y=g.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},k=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},x=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:k}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654",TEST_NXT:"0b6c1f919e95fe61c17a7612aebfaf4fda3a2214",TEST_RHTT4:"f9572c5b119a6b5775a6af07f1cef5d310038f55"},t.TEST_NXT_ADDRESS="AHcLAfnvzzHyuPPULeXrXZ6RK3Hkdvi1qi",t.DEFAULT_RPC={MAIN:"https://seed1.neo.org:10331",TEST:"https://seed1.neo.org:20331"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.DEFAULT_ACCOUNT_CONTRACT={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(133),a=n(i),o=r(134),s=n(o);a.default.setDefaultLevel("silent"),a.default.setAll=function(e){Object.keys(a.default.getLoggers()).map(function(t){a.default.getLogger(t).setLevel(e)})};var f=function(e,t){var r=(new Date).toUTCString();return e=e.toUpperCase(),"["+r+"] ("+t+") "+e+": "};t.default=function(e){var t=a.default.getLogger(e);return s.default.apply(t,{format:f}),t};t.logger=a.default},function(e,t,r){"use strict";function n(e){return"[object Array]"===S.call(e)}function i(e){return"[object ArrayBuffer]"===S.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function c(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===S.call(e)}function l(e){return"[object File]"===S.call(e)}function h(e){return"[object Blob]"===S.call(e)}function p(e){return"[object Function]"===S.call(e)}function b(e){return u(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function y(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),n(e))for(var r=0,i=e.length;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function u(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function d(e,t){return e>>>t|e<<32-t}function l(e,t){return e<>>32-t}function h(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,c=t;return c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function k(e,t,r,n,i,a,o,s,f,c){var u=0,d=t;return d=d+n>>>0,u+=d>>0,u+=d>>0,u+=d>>0,u+=d>>0}function x(e,t,r,n,i,a,o,s,f,c){return t+n+a+s+c>>>0}function S(e,t,r){return(t<<32-r|e>>>r)>>>0}function A(e,t,r){return(e<<32-r|t>>>r)>>>0}function M(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var C=r(10),I=r(19);t.inherits=I,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=c,t.split32=u,t.rotr32=d,t.rotl32=l,t.sum32=h,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=k,t.sum64_5_lo=x,t.rotr64_hi=S,t.rotr64_lo=A,t.shr64_hi=M,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function c(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&f,l=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=l;h++){var p=c-h|0;i=0|e.words[p],a=0|t.words[h],o=i*a+d,u+=o/67108864|0,d=67108863&o}r.words[c]=0|d,f=0|u}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function u(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function d(e,t,r){return(new l).mulp(e,t,r)}function l(e,t){this.x=e,this.y=t}function h(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(38).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","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"],k=[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],x=[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];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=k[e],u=x[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var l=d.modn(u).toString(e);d=d.idivn(u),r=d.isZero()?l+r:_[c-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,c=new e(a),u=this.clone();if(f){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,h=0|o[1],p=8191&h,b=h>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,A=0|o[5],M=8191&A,E=A>>>13,C=0|o[6],I=8191&C,T=C>>>13,P=0|o[7],R=8191&P,B=P>>>13,O=0|o[8],N=8191&O,F=O>>>13,j=0|o[9],z=8191&j,H=j>>>13,q=0|s[0],L=8191&q,D=q>>>13,U=0|s[1],K=8191&U,V=U>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,$=0|s[4],J=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,le=ue>>>13,he=0|s[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(d,L),i=Math.imul(d,D),i=i+Math.imul(l,L)|0,a=Math.imul(l,D);var ve=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,L),i=Math.imul(p,D),i=i+Math.imul(b,L)|0,a=Math.imul(b,D),n=n+Math.imul(d,K)|0,i=i+Math.imul(d,V)|0,i=i+Math.imul(l,K)|0,a=a+Math.imul(l,V)|0;var me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,L),i=Math.imul(m,D),i=i+Math.imul(g,L)|0,a=Math.imul(g,D),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,n=n+Math.imul(d,W)|0,i=i+Math.imul(d,X)|0,i=i+Math.imul(l,W)|0,a=a+Math.imul(l,X)|0;var ge=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,L),i=Math.imul(w,D),i=i+Math.imul(_,L)|0,a=Math.imul(_,D),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,V)|0,i=i+Math.imul(g,K)|0,a=a+Math.imul(g,V)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(d,G)|0,i=i+Math.imul(d,Q)|0,i=i+Math.imul(l,G)|0,a=a+Math.imul(l,Q)|0;var ye=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(x,L),i=Math.imul(x,D),i=i+Math.imul(S,L)|0,a=Math.imul(S,D),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,V)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(d,J)|0,i=i+Math.imul(d,ee)|0,i=i+Math.imul(l,J)|0,a=a+Math.imul(l,ee)|0;var we=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,L),i=Math.imul(M,D),i=i+Math.imul(E,L)|0,a=Math.imul(E,D),n=n+Math.imul(x,K)|0,i=i+Math.imul(x,V)|0,i=i+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(g,G)|0,a=a+Math.imul(g,Q)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,J)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(d,re)|0,i=i+Math.imul(d,ne)|0,i=i+Math.imul(l,re)|0,a=a+Math.imul(l,ne)|0;var _e=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,L),i=Math.imul(I,D),i=i+Math.imul(T,L)|0,a=Math.imul(T,D),n=n+Math.imul(M,K)|0,i=i+Math.imul(M,V)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,V)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,X)|0,i=i+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,J)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(d,ae)|0,i=i+Math.imul(d,oe)|0,i=i+Math.imul(l,ae)|0,a=a+Math.imul(l,oe)|0;var ke=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,L),i=Math.imul(R,D),i=i+Math.imul(B,L)|0,a=Math.imul(B,D),n=n+Math.imul(I,K)|0,i=i+Math.imul(I,V)|0,i=i+Math.imul(T,K)|0,a=a+Math.imul(T,V)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(x,G)|0,i=i+Math.imul(x,Q)|0,i=i+Math.imul(S,G)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(d,fe)|0,i=i+Math.imul(d,ce)|0,i=i+Math.imul(l,fe)|0,a=a+Math.imul(l,ce)|0;var xe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,L),i=Math.imul(N,D),i=i+Math.imul(F,L)|0,a=Math.imul(F,D),n=n+Math.imul(R,K)|0,i=i+Math.imul(R,V)|0,i=i+Math.imul(B,K)|0,a=a+Math.imul(B,V)|0,n=n+Math.imul(I,W)|0,i=i+Math.imul(I,X)|0,i=i+Math.imul(T,W)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(M,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,ee)|0,i=i+Math.imul(S,J)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ce)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0,n=n+Math.imul(d,de)|0,i=i+Math.imul(d,le)|0,i=i+Math.imul(l,de)|0,a=a+Math.imul(l,le)|0;var Se=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,L),i=Math.imul(z,D),i=i+Math.imul(H,L)|0,a=Math.imul(H,D),n=n+Math.imul(N,K)|0,i=i+Math.imul(N,V)|0,i=i+Math.imul(F,K)|0,a=a+Math.imul(F,V)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(B,W)|0,a=a+Math.imul(B,X)|0,n=n+Math.imul(I,G)|0,i=i+Math.imul(I,Q)|0,i=i+Math.imul(T,G)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,i=i+Math.imul(E,J)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,i=i+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ce)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ce)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0,i=i+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0,n=n+Math.imul(d,pe)|0,i=i+Math.imul(d,be)|0,i=i+Math.imul(l,pe)|0,a=a+Math.imul(l,be)|0;var Ae=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,K),i=Math.imul(z,V),i=i+Math.imul(H,K)|0,a=Math.imul(H,V),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,Q)|0,i=i+Math.imul(B,G)|0,a=a+Math.imul(B,Q)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,ee)|0,i=i+Math.imul(T,J)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(x,ae)|0,i=i+Math.imul(x,oe)|0,i=i+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ce)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(m,de)|0,i=i+Math.imul(m,le)|0,i=i+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(z,W),i=Math.imul(z,X),i=i+Math.imul(H,W)|0,a=Math.imul(H,X),n=n+Math.imul(N,G)|0,i=i+Math.imul(N,Q)|0,i=i+Math.imul(F,G)|0,a=a+Math.imul(F,Q)|0,n=n+Math.imul(R,J)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(B,J)|0,a=a+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,i=i+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(M,ae)|0,i=i+Math.imul(M,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(x,fe)|0,i=i+Math.imul(x,ce)|0,i=i+Math.imul(S,fe)|0,a=a+Math.imul(S,ce)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0,i=i+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(z,G),i=Math.imul(z,Q),i=i+Math.imul(H,G)|0,a=Math.imul(H,Q),n=n+Math.imul(N,J)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(F,J)|0,a=a+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(B,re)|0,a=a+Math.imul(B,ne)|0,n=n+Math.imul(I,ae)|0,i=i+Math.imul(I,oe)|0,i=i+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(M,fe)|0,i=i+Math.imul(M,ce)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ce)|0,n=n+Math.imul(x,de)|0,i=i+Math.imul(x,le)|0,i=i+Math.imul(S,de)|0,a=a+Math.imul(S,le)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ce=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(z,J),i=Math.imul(z,ee),i=i+Math.imul(H,J)|0,a=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(F,re)|0,a=a+Math.imul(F,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(B,ae)|0,a=a+Math.imul(B,oe)|0,n=n+Math.imul(I,fe)|0,i=i+Math.imul(I,ce)|0,i=i+Math.imul(T,fe)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(M,de)|0,i=i+Math.imul(M,le)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(x,pe)|0,i=i+Math.imul(x,be)|0,i=i+Math.imul(S,pe)|0,a=a+Math.imul(S,be)|0;var Ie=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,re),i=Math.imul(z,ne),i=i+Math.imul(H,re)|0,a=Math.imul(H,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(F,ae)|0,a=a+Math.imul(F,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ce)|0,i=i+Math.imul(B,fe)|0,a=a+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=i+Math.imul(I,le)|0,i=i+Math.imul(T,de)|0,a=a+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,i=i+Math.imul(M,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Te=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(z,ae),i=Math.imul(z,oe),i=i+Math.imul(H,ae)|0,a=Math.imul(H,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ce)|0,i=i+Math.imul(F,fe)|0,a=a+Math.imul(F,ce)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,le)|0,i=i+Math.imul(B,de)|0,a=a+Math.imul(B,le)|0,n=n+Math.imul(I,pe)|0,i=i+Math.imul(I,be)|0,i=i+Math.imul(T,pe)|0,a=a+Math.imul(T,be)|0;var Pe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(z,fe),i=Math.imul(z,ce),i=i+Math.imul(H,fe)|0,a=Math.imul(H,ce),n=n+Math.imul(N,de)|0,i=i+Math.imul(N,le)|0,i=i+Math.imul(F,de)|0,a=a+Math.imul(F,le)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(B,pe)|0,a=a+Math.imul(B,be)|0;var Re=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(z,de),i=Math.imul(z,le),i=i+Math.imul(H,de)|0,a=Math.imul(H,le),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(F,pe)|0,a=a+Math.imul(F,be)|0;var Be=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,pe),i=Math.imul(z,be),i=i+Math.imul(H,pe)|0,a=Math.imul(H,be);var Oe=(c+n|0)+((8191&i)<<13)|0;return c=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=ke,f[7]=xe,f[8]=Se,f[9]=Ae,f[10]=Me,f[11]=Ee,f[12]=Ce,f[13]=Ie,f[14]=Te,f[15]=Pe,f[16]=Re,f[17]=Be,f[18]=Oe,0!==c&&(f[19]=c,r.length++),r};Math.imul||(S=c),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?S(this,e,t):r<63?c(this,e,t):r<1024?u(this,e,t):d(this,e,t)},l.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},l.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(d)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;0==(r.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var l;return l=0===t.cmpn(1)?i:o,l.cmpn(0)<0&&l.iadd(e),l},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},h.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},h.prototype.split=function(e,t){e.iushrn(this.n,0,t)},h.prototype.imulK=function(e){return e.imul(this.k)},i(p,h),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(A[e])return A[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return A[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=o;0!==h.cmp(s);){for(var b=h,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var c=t.words[n],u=f-1;u>=0;u--){var d=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(39)(e))},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(27),r(28))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,f=r.iterations;o.length>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,c=o<<16|s<<8|f,u=0;u<4&&a+.75*u>>6*(3-u)&63));var d=n.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,c=s.Hasher,u=o.algo,d=[];!function(){for(var e=0;e<64;e++)d[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=u.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var c=this._hash.words,u=e[t+0],l=e[t+1],h=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],x=e[t+12],S=e[t+13],A=e[t+14],M=e[t+15],E=c[0],C=c[1],I=c[2],T=c[3];E=r(E,C,I,T,u,7,d[0]),T=r(T,E,C,I,l,12,d[1]),I=r(I,T,E,C,h,17,d[2]),C=r(C,I,T,E,p,22,d[3]),E=r(E,C,I,T,b,7,d[4]),T=r(T,E,C,I,v,12,d[5]),I=r(I,T,E,C,m,17,d[6]),C=r(C,I,T,E,g,22,d[7]),E=r(E,C,I,T,y,7,d[8]),T=r(T,E,C,I,w,12,d[9]),I=r(I,T,E,C,_,17,d[10]),C=r(C,I,T,E,k,22,d[11]),E=r(E,C,I,T,x,7,d[12]),T=r(T,E,C,I,S,12,d[13]),I=r(I,T,E,C,A,17,d[14]),C=r(C,I,T,E,M,22,d[15]),E=n(E,C,I,T,l,5,d[16]),T=n(T,E,C,I,m,9,d[17]),I=n(I,T,E,C,k,14,d[18]),C=n(C,I,T,E,u,20,d[19]),E=n(E,C,I,T,v,5,d[20]),T=n(T,E,C,I,_,9,d[21]),I=n(I,T,E,C,M,14,d[22]),C=n(C,I,T,E,b,20,d[23]),E=n(E,C,I,T,w,5,d[24]),T=n(T,E,C,I,A,9,d[25]),I=n(I,T,E,C,p,14,d[26]),C=n(C,I,T,E,y,20,d[27]),E=n(E,C,I,T,S,5,d[28]),T=n(T,E,C,I,h,9,d[29]),I=n(I,T,E,C,g,14,d[30]),C=n(C,I,T,E,x,20,d[31]),E=i(E,C,I,T,v,4,d[32]),T=i(T,E,C,I,y,11,d[33]),I=i(I,T,E,C,k,16,d[34]),C=i(C,I,T,E,A,23,d[35]),E=i(E,C,I,T,l,4,d[36]),T=i(T,E,C,I,b,11,d[37]),I=i(I,T,E,C,g,16,d[38]),C=i(C,I,T,E,_,23,d[39]),E=i(E,C,I,T,S,4,d[40]),T=i(T,E,C,I,u,11,d[41]),I=i(I,T,E,C,p,16,d[42]),C=i(C,I,T,E,m,23,d[43]),E=i(E,C,I,T,w,4,d[44]),T=i(T,E,C,I,x,11,d[45]),I=i(I,T,E,C,M,16,d[46]),C=i(C,I,T,E,h,23,d[47]),E=a(E,C,I,T,u,6,d[48]),T=a(T,E,C,I,g,10,d[49]),I=a(I,T,E,C,A,15,d[50]),C=a(C,I,T,E,v,21,d[51]),E=a(E,C,I,T,x,6,d[52]),T=a(T,E,C,I,p,10,d[53]),I=a(I,T,E,C,_,15,d[54]),C=a(C,I,T,E,l,21,d[55]),E=a(E,C,I,T,y,6,d[56]),T=a(T,E,C,I,M,10,d[57]),I=a(I,T,E,C,m,15,d[58]),C=a(C,I,T,E,S,21,d[59]),E=a(E,C,I,T,b,6,d[60]),T=a(T,E,C,I,k,10,d[61]),I=a(I,T,E,C,h,15,d[62]),C=a(C,I,T,E,w,21,d[63]),c[0]=c[0]+E|0,c[1]=c[1]+C|0,c[2]=c[2]+I|0,c[3]=c[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 a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,c=0;c<4;c++){var u=f[c];f[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=c._createHelper(l),o.HmacMD5=c._createHmacHelper(l)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TxAttrUsage=t.Transaction=void 0;var a=r(51);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(21);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(31);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=r(136),c=i(f),u=n(a),d=n(o),l=n(s),h=r(54),p=i(h),b={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){e.exports=r(141)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomArray=t.generatePrivateKey=t.generateSignature=t.getScriptHashFromAddress=t.getAddressFromScriptHash=t.getScriptHashFromPublicKey=t.getVerificationScriptFromPublicKey=t.getPublicKeyFromPrivateKey=t.getWIFFromPrivateKey=t.getPrivateKeyFromWIF=t.getPublicKeyUnencoded=t.getPublicKeyEncoded=void 0;var i=r(72),a=n(i),o=r(6),s=r(25),f=n(s),c=r(1),u=r(3),d=r(123),l=n(d),h=new o.ec("p256"),p=t.getPublicKeyEncoded=function(e){var t=(0,c.hexstring2ab)(e);return t[64]%2==1?"03"+(0,c.ab2hexstring)(t.slice(1,33)):"02"+(0,c.ab2hexstring)(t.slice(1,33))},b=(t.getPublicKeyUnencoded=function(e){return h.keyFromPublic(e,"hex").getPublic().encode("hex")},t.getPrivateKeyFromWIF=function(e){return(0,c.ab2hexstring)(a.default.decode(e,128).privateKey)},t.getWIFFromPrivateKey=function(e){return a.default.encode(128,Buffer.from(e,"hex"),!0)},t.getPublicKeyFromPrivateKey=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,c.reverseHex)((0,c.hash160)(t))},t.getAddressFromScriptHash=function(e){e=(0,c.reverseHex)(e);var t=(0,c.hash256)(u.ADDR_VERSION+e).substr(0,8);return f.default.encode(Buffer.from(u.ADDR_VERSION+e+t,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,c.ab2hexstring)(f.default.decode(e));return(0,c.reverseHex)(t.substr(2,40))},t.generateSignature=function(e,t){var r=(0,c.sha256)(e),n=Buffer.from(r,"hex"),i=new o.ec("p256"),a=i.sign(n,t,null);return Buffer.concat([a.r.toArrayLike(Buffer,"be",32),a.s.toArrayLike(Buffer,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,c.ab2hexstring)((0,l.default)(32))},t.generateRandomArray=function(e){return(0,l.default)(e)}},function(e,t){e.exports=require("crypto")},function(e,t,r){var n=r(75);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){var n=t;n.utils=r(8),n.common=r(16),n.sha=r(85),n.ripemd=r(89),n.hmac=r(90),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},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],f=r[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var u=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+f+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,c=0;c0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return f.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,u.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,u.decrypt)(this.encrypted,e,t),this._updateContractScript(),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:Symbol.toStringTag,get:function(){return"Account"}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=f.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=f.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=f.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=f.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=f.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=f.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClaimItem=t.Coin=t.AssetBalance=void 0;var n=r(1),i=(t.AssetBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{balance:e.balance?new n.Fixed8(e.balance):new n.Fixed8(0),unspent:e.unspent?e.unspent.map(function(e){return i(e)}):[],spent:e.spent?e.spent.map(function(e){return i(e)}):[],unconfirmed:e.unconfirmed?e.unconfirmed.map(function(e){return i(e)}):[]}},t.Coin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{index:e.index||0,txid:e.txid||"",value:e.value?new n.Fixed8(e.value):new n.Fixed8(0)}});t.ClaimItem=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{claim:e.claim?new n.Fixed8(e.claim):new n.Fixed8(0),txid:e.txid||"",index:e.index||0,value:e.value||0,start:e.start?new n.Fixed8(e.start):null,end:e.end?new n.Fixed8(e.end):null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(1),i=r(21),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},l=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},h=function(e){return{script:e.script||"",gas:e.gas||0}};t.serializeExclusive={2:o,128:c,209:l},t.deserializeExclusive={2:a,128:f,209:d},t.getExclusive={2:s,128:u,209:h}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(137);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(53),o=n(a),s=r(52),f=n(s),c=r(138),u=n(c),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s},function(e,t,r){"use strict";var n=r(58);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getAPIEndpoint=t.name=void 0;var i=r(22),a=n(i),o=r(7),s=r(14),f=r(17),c=r(3),u=r(1),d=r(4),l=n(d),h=(0,l.default)("api"),p=(t.name="neonDB",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}}),b=t.getBalance=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/balance/"+t).then(function(r){var n=new o.Balance({net:e,address:r.data.address});return Object.keys(r.data).map(function(e){"net"!==e&&"address"!==e&&n.addAsset(e,r.data[e])}),h.info("Retrieved Balance for "+t+" from neonDB "+e),n})},v=t.getClaims=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){var n=r.data;return n.claims=n.claims.map(function(e){return{claim:new u.Fixed8(e.claim).div(1e8),index:e.index,txid:e.txid,start:new u.Fixed8(e.start),end:new u.Fixed8(e.end),value:e.value}}),h.info("Retrieved Claims for "+t+" from neonDB "+e),new o.Claims(n)})},m=(t.getMaxClaimAmount=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/claims/"+t).then(function(r){return h.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neonDB "+e),new u.Fixed8(r.data.total_claim+r.data.total_unspent_claim).div(1e8)})},t.getRPCEndpoint=function(e){var t=p(e);return a.default.get(t+"/v2/network/nodes").then(function(e){var t=e.data.nodes.filter(function(e){return e.status}),r=0,n=[],i=!0,a=!1,o=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var c=s.value;c.block_height>r?(r=c.block_height,n=[c]):c.block_height===r&&n.push(c)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})});t.getTransactionHistory=function(e,t){var r=p(e);return a.default.get(r+"/v2/address/history/"+t).then(function(r){return h.info("Retrieved History for "+t+" from neonDB "+e),r.data.history})},t.getWalletDBHeight=function(e){var t=p(e);return a.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){h.warn("doClaimAllGas will be deprecated in favor of claimGas");var n=new o.Account(t),i=m(e),a=v(e,n.address),c=void 0,u=void 0;return Promise.all([i,a]).then(function(e){u=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=s.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return c=e,f.Query.sendRawTransaction(c).execute(u)}).then(function(e){return!0===e.result?e.txid=c:h.error("Transaction failed: "+c.serialize()),e})},t.doMintTokens=function(e,t,r,n,i,a){h.warn("doMintTokens will be deprecated in favor of doInvoke");var d=new o.Account(r),l=[{assetId:c.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t,args:[]},v=m(e),g=b(e,d.address),y=void 0,w=void 0;return Promise.all([v,g]).then(function(e){w=e[0];var r=e[1],n=[{data:(0,u.reverseHex)(t),usage:s.TxAttrUsage.Script}],o=s.Transaction.createInvocationTx(r,l,p,i,{attributes:n});return a?a(o,d.publicKey):o.sign(d.privateKey)}).then(function(e){return y=e,f.Query.getContractState(t).execute(w)}).then(function(e){var t={invocationScript:"0000",verificationScript:e.result.script};return y.scripts.unshift(t),f.Query.sendRawTransaction(y).execute(w)}).then(function(e){return!0===e.result?e.txid=y.hash:h.error("Transaction failed: "+y.serialize()),e})},t.doSendAsset=function(e,t,r,n,i){h.warn("doSendAsset will be deprecated in favor of sendAsset");var a=new o.Account(r),u=new o.Account(t),d=m(e),l=b(e,a.address),p=Object.keys(n).map(function(e){return{assetId:c.ASSET_ID[e],value:n[e],scriptHash:u.scriptHash}}),v=void 0,g=void 0;return Promise.all([d,l]).then(function(e){g=e[0];var t=e[1],r=s.Transaction.createContractTx(t,p);return i?i(r,a.publicKey):r.sign(a.privateKey)}).then(function(e){return v=e,f.Query.sendRawTransaction(v).execute(g)}).then(function(e){return!0===e.result?e.txid=v.hash:h.error("Transaction failed: "+v.serialize()),e})}},function(e,t,r){"use strict";function n(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}var i=r(73),a=r(74);e.exports=a(n)},function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=r(38),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t){e.exports=require("buffer")},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function u(e){return l(e,17)^l(e,19)^e>>>10}var d=r(8),l=d.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=c,t.g1_256=u},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(8),a=r(16),o=r(41),s=r(10),f=i.sum32,c=i.sum32_4,u=i.sum32_5,d=o.ch32,l=o.maj32,h=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[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];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=b+c[h-7]+m+c[h-16]}var g=s&u^~s&d,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=l+_+g+f[h]+c[h],x=w+y;l=d,d=u,u=s,s=o+k|0,o=a,a=i,i=n,n=k+x|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+l|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 e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(u),r.HmacSHA256=a._createHmacHelper(u)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,c=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=t()}();var d=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],d=r[6],l=r[7],h=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,k=s.low,x=f.high,S=f.low,A=d.high,M=d.low,E=l.high,C=l.low,I=h,T=p,P=b,R=v,B=m,O=g,N=y,F=w,j=_,z=k,H=x,q=S,L=A,D=M,U=E,K=C,V=0;V<80;V++){var Y=u[V];if(V<16)var W=Y.high=0|e[t+2*V],X=Y.low=0|e[t+2*V+1];else{var Z=u[V-15],G=Z.high,Q=Z.low,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=u[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,fe=u[V-16],ce=fe.high,ue=fe.low,X=J+se,W=$+oe+(X>>>0>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ue,W=W+ce+(X>>>0>>0?1:0);Y.high=W,Y.low=X}var de=j&H^~j&L,le=z&q^~z&D,he=I&P^I&B^P&B,pe=T&R^T&O^R&O,be=(I>>>28|T<<4)^(I<<30|T>>>2)^(I<<25|T>>>7),ve=(T>>>28|I<<4)^(T<<30|I>>>2)^(T<<25|I>>>7),me=(j>>>14|z<<18)^(j>>>18|z<<14)^(j<<23|z>>>9),ge=(z>>>14|j<<18)^(z>>>18|j<<14)^(z<<23|j>>>9),ye=c[V],we=ye.high,_e=ye.low,ke=K+ge,xe=U+me+(ke>>>0>>0?1:0),ke=ke+le,xe=xe+de+(ke>>>0>>0?1:0),ke=ke+_e,xe=xe+we+(ke>>>0<_e>>>0?1:0),ke=ke+X,xe=xe+W+(ke>>>0>>0?1:0),Se=ve+pe,Ae=be+he+(Se>>>0>>0?1:0);U=L,K=D,L=H,D=q,H=j,q=z,z=F+ke|0,j=N+xe+(z>>>0>>0?1:0)|0,N=B,F=O,B=P,O=R,P=I,R=T,T=ke+Se|0,I=xe+Ae+(T>>>0>>0?1:0)|0}p=n.low=p+T,n.high=h+I+(p>>>0>>0?1:0),v=i.low=v+R,i.high=b+P+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+B+(g>>>0>>0?1:0),w=o.low=w+F,o.high=y+N+(w>>>0>>0?1:0),k=s.low=k+z,s.high=_+j+(k>>>0>>0?1:0),S=f.low=S+q,f.high=x+H+(S>>>0>>0?1:0),M=d.low=M+D,d.high=A+L+(M>>>0>>0?1:0),C=l.low=C+K,l.high=E+U+(C>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(d),r.HmacSHA512=i._createHmacHelper(d)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(25),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(1),o=r(23);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptAsync=t.decrypt=t.encryptAsync=t.encrypt=void 0;var i=r(36),a=n(i),o=r(44),s=r(124),f=n(s),c=r(132),u=n(c),d=r(29),l=n(d),h=r(1),p=r(3),b=r(4),v=n(b),m=(0,v.default)("wallet");m.warn("ScryptParams will be changing to use n,r,p in place of cost, blockSize, parallel. New standard will be preferred. DEFAULT_SCRYPT will use new standard upon major version bump.");var g=(t.encrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;r=g(r);var n={cost:r.n,blockSize:r.r,parallel:r.p},i=new l.default(e),s=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(i.address))).toString().slice(0,8),c=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(s,"hex"),n).toString("hex"),u=c.slice(0,64),d=c.slice(64),b=(0,h.hexXor)(i.privateKey,u),v=o.AES.encrypt(o.enc.Hex.parse(b),o.enc.Hex.parse(d),{mode:o.mode.ECB,padding:o.pad.NoPadding}),y=p.NEP_HEADER+p.NEP_FLAG+s+v.ciphertext.toString(),w=a.default.encode(Buffer.from(y,"hex"));return m.info("Successfully encrypted key to "+w),w},t.encryptAsync=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(n,i){r=g(r);var s=r,f=s.n,c=s.r,d=s.p,b=new l.default(e),v=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(b.address))).toString().slice(0,8);(0,u.default)(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(v,"hex"),f,c,d,64,function(e,t,r){if(null!=e)i(e);else if(r){var s=Buffer.from(r).toString("hex"),f=s.slice(0,64),c=s.slice(64),u=(0,h.hexXor)(b.privateKey,f),d=o.AES.encrypt(o.enc.Hex.parse(u),o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),l=p.NEP_HEADER+p.NEP_FLAG+v+d.ciphertext.toString(),g=a.default.encode(Buffer.from(l,"hex"));m.info("Successfully encrypted key to "+g),n(g)}})})},t.decrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;r=g(r);var n={cost:r.n,blockSize:r.r,parallel:r.p},i=(0,h.ab2hexstring)(a.default.decode(e)),s=i.substr(6,8),c=i.substr(-64),u=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(s,"hex"),n).toString("hex"),d=u.slice(0,64),b=u.slice(64),v={ciphertext:o.enc.Hex.parse(c),salt:""},y=o.AES.decrypt(v,o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),w=(0,h.hexXor)(y.toString(),d),_=new l.default(w);if(s!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(_.address))).toString().slice(0,8))throw new Error("Wrong Password!");return m.info("Successfully decrypted "+e),_.WIF},t.decryptAsync=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.DEFAULT_SCRYPT;return new Promise(function(n,i){r=g(r);var s=r,f=s.n,c=s.r,d=s.p,p=(0,h.ab2hexstring)(a.default.decode(e)),b=p.substr(6,8),v=p.substr(-64);(0,u.default)(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(b,"hex"),f,c,d,64,function(t,r,a){if(null!=t)i(t);else if(a){var s=Buffer.from(a).toString("hex"),f=s.slice(0,64),c=s.slice(64),u={ciphertext:o.enc.Hex.parse(v),salt:""},d=o.AES.decrypt(u,o.enc.Hex.parse(c),{mode:o.mode.ECB,padding:o.pad.NoPadding}),p=(0,h.hexXor)(d.toString(),f),g=new l.default(p),y=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8);if(b!==y)throw new Error("Wrong Password!");m.info("Successfully decrypted "+e),n(g.WIF)}})})},function(e){var t=Object.assign({},p.DEFAULT_SCRYPT,e);return{n:t.n||t.cost,r:t.r||t.blockSize,p:t.p||t.parallel}})},function(e,t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?Buffer("","utf8"):e instanceof Buffer?e:"string"==typeof e?new Buffer(e,"utf8"):new Buffer(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:c(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function c(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r},function(e,t){e.exports=require("fs")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(1),i=r(7),a=r(31),o=r(3),s=r(21),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),c=r(4),u=function(e){return e&&e.__esModule?e:{default:e}}(c),d=(0,u.default)("tx"),l=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var i=t.reduce(function(e,t){return e[t.assetId]?e[t.assetId]=e[t.assetId].add(t.value):e[t.assetId]=t.value,e},{});return r=new n.Fixed8(r),r.gt(0)&&(i[o.ASSET_ID.GAS]?i[o.ASSET_ID.GAS]=i[o.ASSET_ID.GAS].add(r):i[o.ASSET_ID.GAS]=r),Object.keys(i).map(function(t){var r=i[t],n=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(n))throw new Error("This balance does not contain any "+n+"!");var a=e.assets[n];if(a.balance.lt(r))throw new Error("Insufficient "+o.ASSETS[t]+"! Need "+r.toString()+" but only found "+a.balance.toString());return l(a,r,t,e.address)}).reduce(function(e,t){return{inputs:e.inputs.concat(t.inputs),change:e.change.concat(t.change)}},{inputs:[],change:[]})},function(e,t,r,a){e.unspent.sort(function(e,t){return e.value.sub(t.value)});for(var s=0,f=new n.Fixed8(0);f.lt(t);){if((s+=1)>e.unspent.length)throw new Error("Insufficient "+o.ASSETS[r]+"! Reached end of unspent coins! "+e.unspent.length);f=f.add(e.unspent[s-1].value)}var c=[];return f.gt(t)&&c.push({assetId:r,value:f.sub(t),scriptHash:(0,i.getScriptHashFromAddress)(a)}),{inputs:e.unspent.slice(0,s).map(function(e){return{prevHash:e.txid,prevIndex:e.index}}),change:c}}),h=t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var c,u=e.attributes[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value;r+=f.serializeTransactionAttribute(d)}}catch(e){o=!0,s=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var l=!0,h=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(l=(b=v.next()).done);l=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){h=!0,p=e}finally{try{!l&&v.return&&v.return()}finally{if(h)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,k=e.outputs[Symbol.iterator]();!(g=(_=k.next()).done);g=!0){var x=_.value;r+=f.serializeTransactionOutput(x)}}catch(e){y=!0,w=e}finally{try{!g&&k.return&&k.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var S=!0,A=!1,M=void 0;try{for(var E,C=e.scripts[Symbol.iterator]();!(S=(E=C.next()).done);S=!0){var I=E.value;r+=f.serializeWitness(I)}}catch(e){A=!0,M=e}finally{try{!S&&C.return&&C.return()}finally{if(A)throw M}}}return r};t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]&&arguments[1];if((0,f.ensureHex)(e),40!==e.length)throw new Error("ScriptHash should be 20 bytes long!");return this.emit(t?u.default.TAILCALL:u.default.APPCALL,(0,f.reverseHex)(e))}},{key:"_emitArray",value:function(e){for(var t=e.length-1;t>=0;t--)this.emitPush(e[t]);return this.emitPush(e.length).emit(u.default.PACK)}},{key:"_emitString",value:function(e){(0,f.ensureHex)(e);var t=e.length/2;return t<=u.default.PUSHBYTES75?(this.str+=(0,f.num2hexstring)(t),this.str+=e):t<256?(this.emit(u.default.PUSHDATA1),this.str+=(0,f.num2hexstring)(t),this.str+=e):t<65536?(this.emit(u.default.PUSHDATA2),this.str+=(0,f.num2hexstring)(t,2),this.str+=e):(this.emit(u.default.PUSHDATA4),this.str+=(0,f.num2hexstring)(t,4),this.str+=e),this}},{key:"_emitNum",value:function(e){if(-1===e)return this.emit(u.default.PUSHM1);if(0===e)return this.emit(u.default.PUSH0);if(e>0&&e<=16)return this.emit(u.default.PUSH1-1+e);var t=(0,f.int2hex)(e);return this.emitPush((0,f.reverseHex)("0".repeat(16-t.length)+t))}},{key:"_emitParam",value:function(e){if(!e.type)throw new Error("No type available!");if(!l(e.value))throw new Error("Invalid value provided!");switch(e.type){case"String":return this._emitString((0,f.str2hexstring)(e.value));case"Boolean":return this.emit(e.value?u.default.PUSHT:u.default.PUSHF);case"Integer":return this._emitNum(e.value);case"ByteArray":return this._emitString(e.value);case"Array":return this._emitArray(e.value);case"Hash160":return this._emitString((0,f.reverseHex)(e.value))}}},{key:"emit",value:function(e,t){return this.str+=(0,f.num2hexstring)(e),t&&(this.str+=t),this}},{key:"emitAppCall",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.emitPush(r),t){for(var i="",a=0;a1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBlockHash",value:function(t){return new e({method:"getblockhash",params:[t]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;a=300&&e.statusCode<400){if(++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new Error("Max redirects exceeded."));var r,n=this._options.headers;if(307!==e.statusCode&&!(this._options.method in d)){this._options.method="GET",this._requestBodyBuffers=[];for(r in n)/^content-/i.test(r)&&delete n[r]}if(!this._isRedirect)for(r in n)/^host$/i.test(r)&&delete n[r];var i=a.resolve(this._currentUrl,t);u("redirecting to",i),Object.assign(this._options,a.parse(i)),this._isRedirect=!0,this._performRequest()}else e.responseUrl=this._currentUrl,this.emit("response",e),this._requestBodyBuffers=[]},e.exports=i({http:o,https:s}),e.exports.wrap=i},function(e,t){e.exports=require("url")},function(e,t,r){function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){function r(){if(r.enabled){var e=r,n=+new Date,a=n-(i||n);e.diff=a,e.prev=i,e.curr=n,i=n;for(var o=new Array(arguments.length),s=0;s=0&&e<=1&&(d=e)},t.setSwitchFreeze=function(e){l=!!e,u.info("core/setSwitchFreeze API switch is frozen: "+l)},function(){!l&&d>0&&(d-=.2,u.info("core API Switch increasing weight towards neoscan"))}),p=function(){!l&&d<1&&(d+=.2,u.info("core API Switch increasing weight towards neonDB"))};t.loadBalance=function(e,t){return Math.random()>d?e(t,s).then(function(e){return h(),e}).catch(function(){return p(),e(t,a)}):e(t,a).then(function(e){return p(),e}).catch(function(){return h(),e(t,s)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHistory=t.getWalletDBHeight=t.getMaxClaimAmount=t.getClaims=t.getBalance=t.getRPCEndpoint=t.getAPIEndpoint=t.name=void 0;var i=r(22),a=n(i),o=r(7),s=r(3),f=r(1),c=r(4),u=n(c),d=(0,u.default)("api"),l=(t.name="neoscan",t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"https://api.neoscan.io/api/main_net";case"TestNet":return"https://neoscan-testnet.io/api/test_net";default:return e}}),h=(t.getRPCEndpoint=function(e){var t=l(e);return a.default.get(t+"/v1/get_all_nodes").then(function(t){var r=t.data,n=0,i=[],a=!0,o=!1,s=void 0;try{for(var f,c=r[Symbol.iterator]();!(a=(f=c.next()).done);a=!0){var u=f.value;u.height>n?(n=u.height,i=[u]):u.height===n&&i.push(u)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}var l=i[Math.floor(Math.random()*i.length)].url;return d.info("Best node from neoscan "+e+": "+l),l})},t.getBalance=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_balance/"+t).then(function(r){if(r.data.address!==t&&null===r.data.balance)return new o.Balance({address:r.data.address});var n=new o.Balance({address:r.data.address,net:e});return r.data.balance.map(function(e){n.addAsset(e.asset,{balance:e.amount,unspent:h(e.unspent)})}),d.info("Retrieved Balance for "+t+" from neoscan "+e),n})},t.getClaims=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){if(r.address!==t&&null===r.data.claimable)return new o.Claims({address:r.data.address});var n=p(r.data.claimable);return d.info("Retrieved Balance for "+t+" from neoscan "+e),new o.Claims({net:e,address:r.data.address,claims:n})})},t.getMaxClaimAmount=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_claimable/"+t).then(function(r){return d.info("Retrieved maximum amount of gas claimable after spending all NEO for "+t+" from neoscan "+e),new f.Fixed8(r.data.unclaimed||0)})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),p=function(e){return e.map(function(e){return{start:new f.Fixed8(e.start_height),end:new f.Fixed8(e.end_height),index:e.n,claim:new f.Fixed8(e.unclaimed),txid:e.txid,value:e.value}})},b=(t.getWalletDBHeight=function(e){var t=l(e);return a.default.get(t+"/v1/get_height").then(function(e){return parseInt(e.data.height)})},t.getTransactionHistory=function(e,t){var r=l(e);return a.default.get(r+"/v1/get_address_neon/"+t).then(function(r){return d.info("Retrieved History for "+t+" from neoscan "+e),b(r.data.txids)})},function(e){return e.map(function(e){var t=e.txid,r=e.block_height,n=e.balance,i=e.asset_moved,a=!1,o=!1,f=s.ASSETS.GAS,c=s.ASSETS.NEO;return n.forEach(function(e){var t=e.asset,r=e.amount;t===f&&(f=r),t===c&&(c=r)}),s.ASSET_ID.GAS===i&&(a=!0),s.ASSET_ID.NEO===i&&(o=!0),{GAS:f,NEO:c,block_index:r,gas_sent:a,neo_sent:o,txid:t}})})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.logging=t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(70),a=n(i),o=r(17),s=n(o),f=r(3),c=n(f),u=r(32),d=n(u),l=r(14),h=n(l),p=r(7),b=n(p),v=r(1),m=n(v),g=r(4),y=n(g),w=[d.default,h.default,b.default,a.default,s.default],_=w.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:c,u:m});t.default=_,t.api=a,t.rpc=s,t.sc=d,t.tx=h,t.wallet=b,t.u=m,t.CONST=c,t.logging=y},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(71);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(67);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(35),s=n(o),f=r(171),c=n(f),u=r(172),d=n(u),l=r(68),h=n(l),p=n(i);t.default={get:{price:c.getPrice,prices:c.getPrices,balance:s.getBalance,claims:s.getClaims,transactionHistory:s.getTransactionHistory,tokenBalance:d.getTokenBalance,tokenInfo:d.getTokenInfo,token:d.getToken},do:{sendAsset:s.doSendAsset,claimAllGas:s.doClaimAllGas,mintTokens:s.doMintTokens},sendAsset:function(e){return p.sendAsset(e)},claimGas:function(e){return p.claimGas(e)},doInvoke:function(e){return p.doInvoke(e)}},t.neonDB=s,t.cmc=c,t.nep5=d,t.neoscan=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxClaimAmountFrom=t.getWalletDBHeightFrom=t.getTransactionHistoryFrom=t.getRPCEndpointFrom=t.getClaimsFrom=t.getBalanceFrom=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.fillKeys=t.fillBalance=t.fillUrl=t.doInvoke=t.claimGas=t.sendAsset=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(7),a=r(3),o=r(17),s=r(14),f=r(1),c=r(67),u=r(4),d=function(e){return e&&e.__esModule?e:{default:e}}(u),l=(0,d.default)("api"),h=(t.sendAsset=function(e){return h(e).then(b).then(p).then(function(e){return v(e,"contract")}).then(function(e){return _(e)}).then(function(e){return m(e)}).then(function(e){return k(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,tx:e.tx};throw l.error("sendAsset failed with: "+t.message+". Dumping config",r),t})},t.claimGas=function(e){return h(e).then(b).then(function(t){return(0,c.loadBalance)(A,e)}).then(function(e){return v(e,"claim")}).then(function(e){return m(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,claims:e.claims,tx:e.tx};throw l.error("claimGas failed with "+t.message+". Dumping config",r),t})},t.doInvoke=function(e){return h(e).then(b).then(p).then(function(e){return v(e,"invocation")}).then(function(e){return _(e)}).then(function(e){return y(e)}).then(function(e){return m(e)}).then(function(e){return w(e)}).then(function(e){return k(e)}).then(function(e){return g(e)}).catch(function(t){var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,script:e.script,gas:e.gas,tx:e.tx};throw l.error("doInvoke failed with "+t.message+". Dumping config",r),t})},t.fillUrl=function(e){return e.url?Promise.resolve(e):(0,c.loadBalance)(M,e).then(function(t){return Object.assign(e,{url:t})})}),p=t.fillBalance=function(e){return e.balance?Promise.resolve(e):(0,c.loadBalance)(S,e)},b=t.fillKeys=function(e){return e.account&&(e.address||(e.address=e.account.address),e.privateKey||e.signingFunction||(e.privateKey=e.account.privateKey),!e.publicKey&&e.signingFunction&&(e.publicKey=e.account.publicKey)),Promise.resolve(e)},v=t.createTx=function(e,t){if(e.tx)return e;"string"==typeof t&&(t=t.toLowerCase());var r=void 0;switch(t){case"claim":case 2:x(e,"claims"),r=s.Transaction.createClaimTx(e.address,e.claims);break;case"contract":case 128:x(e,"balance","intents"),r=s.Transaction.createContractTx(e.balance,e.intents,e.override);break;case"invocation":case 209:x(e,"balance","gas","script"),e.intents||(e.intents=[]),r=s.Transaction.createInvocationTx(e.balance,e.intents,e.script,e.gas,e.override);break;default:return Promise.reject(new Error("Tx Type not found: "+t))}return Promise.resolve(Object.assign(e,{tx:r}))},m=t.signTx=function(e){x(e,"tx");var t=void 0;if(e.signingFunction){var r=new i.Account(e.publicKey);t=e.signingFunction(e.tx,r.publicKey).then(function(e){return"string"==typeof e&&(e=s.Transaction.deserialize(e)),e})}else{if(!e.privateKey)return Promise.reject(new Error("Needs privateKey or signingFunction to sign!"));var n=new i.Account(e.privateKey);if(e.address!==n.address&&!e.sendingFromSmartContract)return Promise.reject(new Error("Private Key and Balance address does not match!"));t=Promise.resolve(e.tx.sign(n.privateKey))}return t.then(function(t){return Object.assign(e,{tx:t})})},g=t.sendTx=function(e){return x(e,"tx","url"),o.Query.sendRawTransaction(e.tx).execute(e.url).then(function(t){if(!0===t.result)t.txid=e.tx.hash,e.balance&&e.balance.applyTx(e.tx,!1);else{var r={net:e.net,address:e.address,intents:e.intents,balance:e.balance,claims:e.claims,script:e.script,gas:e.gas,tx:e.tx};l.error("Transaction failed for "+e.address+": "+e.tx.serialize(),r)}return Object.assign(e,{response:t})})},y=(t.makeIntent=function(e,t){var r=new i.Account(t);return Object.keys(e).map(function(t){return(0,s.TransactionOutput)({assetId:a.ASSET_ID[t],value:e[t],scriptHash:r.scriptHash})})},function(e){return e.override||(e.override={}),"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash&&e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(e.script.scriptHash)),Promise.resolve(e)}),w=function(e){return"object"===n(e.script)&&"mintTokens"===e.script.operation&&e.script.scriptHash?o.Query.getContractState(e.script.scriptHash).execute(e.url).then(function(t){var r=t.result.parameters,n={invocationScript:"00".repeat(r.length),verificationScript:""},a=new i.Account(e.address);return parseInt(e.script.scriptHash,16)>parseInt(a.scriptHash,16)?e.tx.scripts.push(n):e.tx.scripts.unshift(n),e}):Promise.resolve(e)},_=function(e){if(e.override||(e.override={}),e.sendingFromSmartContract){var t=e.privateKey?new i.Account(e.privateKey):new i.Account(e.publicKey);e.tx.addAttribute(s.TxAttrUsage.Script,(0,f.reverseHex)(t.scriptHash))}return Promise.resolve(e)},k=function(e){if(e.sendingFromSmartContract){var t=(0,i.getScriptHashFromAddress)(e.address);return o.Query.getContractState(t).execute(e.url).then(function(r){var n=r.result.parameters,a={invocationScript:"00".repeat(n.length),verificationScript:""},o=new i.Account(e.address);return parseInt(t,16)>parseInt(o.scriptHash,16)?e.tx.scripts.push(a):e.tx.scripts.unshift(a),e})}return Promise.resolve(e)},x=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0;)r.push(a%o),a=a/o|0}for(var f="",c=0;0===t[c]&&c=0;--u)f+=e[r[u]];return f}function r(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.allocUnsafe(0);for(var t=[0],r=0;r>=8;for(;c>0;)t.push(255&c),c>>=8}for(var u=0;e[u]===s&&u=0;){var a;if(i.isOdd()){var o=i.andln(n-1);a=o>(n>>1)-1?(n>>1)-o:o,i.isubn(a)}else a=0;r.push(a);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,o=t.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var f=e.andln(7)+n&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var c;if(0==(1&o))c=0;else{var f=t.andln(7)+i&7;c=3!==f&&5!==f||2!==a?o:-o}r[1].push(c),2*n===s+1&&(n=1-n),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function a(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function o(e){return"string"==typeof e?f.toArray(e,"hex"):e}function s(e){return new c(e,"hex","le")}var f=t,c=r(9),u=r(10),d=r(40);f.assert=u,f.toArray=d.toArray,f.zero2=d.zero2,f.toHex=d.toHex,f.encode=d.encode,f.getNAF=n,f.getJSF=i,f.cachedProperty=a,f.parseBytes=o,f.intFromLE=s},function(e,t,r){function n(e){this.rand=e}var i;if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,t){this.curve=e,this.type=t,this.precomputed=null}var a=r(9),o=r(6),s=o.utils,f=s.getNAF,c=s.getJSF,u=s.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(e,t){u(e.precomputed);var r=e._getDoubles(),n=f(t,1),i=(1<=o;t--)s=(s<<1)+n[t];a.push(s)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(var o=0;o=0;s--){for(var t=0;s>=0&&0===a[s];s--)t++;if(s>=0&&t++,o=o.dblp(t),s<0)break;var c=a[s];u(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},n.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,u=0,d=0;d=1;d-=2){var p=d-1,b=d;if(1===a[p]&&1===a[b]){var v=[t[p],null,null,t[b]];0===t[p].y.cmp(t[b].y)?(v[1]=t[p].add(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg())):0===t[p].y.cmp(t[b].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].add(t[b].neg())):(v[1]=t[p].toJ().mixedAdd(t[b]),v[2]=t[p].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=c(r[p],r[b]);u=Math.max(g[0].length,u),s[p]=new Array(u),s[b]=new Array(u);for(var y=0;y=0;d--){for(var S=0;d>=0;){for(var A=!0,y=0;y=0&&S++,k=k.dblp(S),d<0)break;for(var y=0;y0?l=o[y][M-1>>1]:M<0&&(l=o[y][-M-1>>1].neg()),k="affine"===l.type?k.mixedAdd(l):k.add(l))}}for(var d=0;d=Math.ceil((e.bitLength()+1)/t.step)},i.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},n.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),f=i.mul(r.b),c=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:f.add(c).neg()}},n.prototype.pointFromX=function(e,t){e=new f(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.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(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},n.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(e){return e=new f(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},i.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},i.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},c(a,u.BasePoint),n.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),d=n.redMul(c),l=f.redSqr().redIAdd(u).redISub(d).redISub(d),h=f.redMul(d.redISub(l)).redISub(a.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),c=f.redMul(o),u=r.redMul(f),d=s.redSqr().redIAdd(c).redISub(u).redISub(u),l=s.redMul(u.redISub(d)).redISub(i.redMul(c)),h=this.z.redMul(o);return this.curve.jpoint(d,l,h)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";function n(e){f.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,t,r){f.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(t,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(18),o=r(9),s=r(19),f=a.base,c=r(6),u=c.utils;s(n,f),e.exports=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},s(i,f.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(u.toArray(e,t),1)},n.prototype.point=function(e,t){return new i(this,e,t)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,t){return new i(e,t[0],t[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=t.redSub(n),a=t.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(r),s=i.redMul(n),f=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,c)},i.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";function n(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,c.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function i(e,t,r,n,i){c.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(18),o=r(6),s=r(9),f=r(19),c=a.base,u=o.utils.assert;f(n,c),e.exports=n,n.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},n.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},n.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},n.prototype.pointFromX=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o)},n.prototype.pointFromY=function(e,t){e=new s(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},n.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},f(i,c.BasePoint),n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},n.prototype.point=function(e,t,r,n){return new i(this,e,t,r,n)},i.fromJSON=function(e,t){return new i(e,t[0],t[1],t[2])},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),f=i.redMul(o),c=a.redMul(s),u=i.redMul(s),d=o.redMul(a);return this.curve.point(f,c,d,u)},i.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),s=o.redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),c=s.redSub(f).redISub(f);e=n.redSub(i).redISub(a).redMul(c),t=s.redMul(o.redSub(a)),r=s.redMul(c)}}else{var o=i.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=o.redSub(f).redSub(f);e=this.curve._mulC(n.redISub(o)).redMul(c),t=this.curve._mulC(o).redMul(i.redISub(a)),r=o.redMul(c)}return this.curve.point(e,t,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),c=a.redMul(o),u=s.redMul(f),d=a.redMul(f),l=o.redMul(s);return this.curve.point(c,u,l,d)},i.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),f=i.redSub(s),c=i.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=n.redMul(f).redMul(u);return this.curve.twisted?(t=n.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(c)):(t=n.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(d,t,r)},i.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},i.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},i.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},i.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},i.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},function(e,t,r){"use strict";function n(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new n(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}var a=t,o=r(26),s=r(6),f=s.utils.assert;a.PresetCurve=n,i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]}),i("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"]});var c;try{c=r(91)}catch(e){c=void 0}i("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",c]})},function(e,t,r){"use strict";t.sha1=r(86),t.sha224=r(87),t.sha256=r(42),t.sha384=r(88),t.sha512=r(43)},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var i=r(8),a=r(16),o=r(41),s=i.rotl32,f=i.sum32,c=i.sum32_5,u=o.ft_1,d=a.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];i.inherits(n,d),e.exports=n,n.blockSize=512,n.outSize=160,n.hmacStrength=80,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},n.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},n.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),f=e.toArray("be",o),c=new a({hash:this.hash,entropy:s,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new i(1)),l=0;!0;l++){var h=n.k?n.k(l):new i(c.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(d)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var m=h.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(m=m.umod(this.n),0!==m.cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new u({r:v,s:m,recoveryParam:g})}}}}}},n.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n),t=new u(t,"hex");var a=t.r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(e).umod(this.n),c=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var d=this.g.mulAdd(f,r.getPublic(),c);return!d.isInfinity()&&0===d.getX().umod(this.n).cmp(a)}var d=this.g.jmulAdd(f,r.getPublic(),c);return!d.isInfinity()&&d.eqXToP(a)},n.prototype.recoverPubKey=function(e,t,r,n){f((3&r)===r,"The recovery param is more than two bits"),t=new u(t,n);var a=this.n,o=new i(e),s=t.r,c=t.s,d=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var h=t.r.invm(a),p=a.sub(o).mul(h).umod(a),b=c.mul(h).umod(a);return this.g.mulAdd(p,s,b)},n.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new u(t,n),null!==t.recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var i=r(26),a=r(40),o=r(10);e.exports=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},n.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"}},function(e,t,r){"use strict";function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(d(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function i(){this.place=0}function a(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}var f=r(9),c=r(6),u=c.utils,d=u.assert;e.exports=n,n.prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new i;if(48!==e[r.place++])return!1;if(a(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=a(e,r),o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=a(e,r);if(e.length!==s+r.place)return!1;var c=e.slice(r.place,s+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new f(o),this.s=new f(c),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,t.length),n=n.concat(t),n.push(2),s(n,r.length);var i=n.concat(r),a=[48];return s(a,i.length),a=a.concat(i),u.encode(a,e)}},function(e,t,r){"use strict";function n(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof n))return new n(e);var e=a.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}var i=r(26),a=r(6),o=a.utils,s=o.assert,f=o.parseBytes,c=r(97),u=r(98);e.exports=n,n.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},n.prototype.verify=function(e,t,r){e=f(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},n.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>>2]|=e[n]<<24-n%4*8;i.call(this,r,t)}else i.apply(this,arguments)}).prototype=n}}(),e.lib.WordArray})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return i.create(r,2*t)}};a.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],a=0;a>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a>>1]|=t(e.charCodeAt(a)<<16-a%2*16);return i.create(n,2*r)}}}(),e.enc.Utf16})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(45))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=t.algo,a=i.SHA256,o=i.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=a._createHelper(o),t.HmacSHA224=a._createHmacHelper(o)}(),e.SHA224})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20),r(46))}(0,function(e){return function(){var t=e,r=t.x64,n=r.Word,i=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),e.SHA384})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64,s=o.Word,f=r.algo,c=[],u=[],d=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,o=0;o<24;o++){for(var f=0,l=0,h=0;h<7;h++){if(1&a){var p=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=r[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var h=0;h<5;h++){for(var p=0,b=0,v=0;v<5;v++){var s=r[h+5*v];p^=s.high,b^=s.low}var m=l[h];m.high=p,m.low=b}for(var h=0;h<5;h++)for(var g=l[(h+4)%5],y=l[(h+1)%5],w=y.high,_=y.low,p=g.high^(w<<1|_>>>31),b=g.low^(_<<1|w>>>31),v=0;v<5;v++){var s=r[h+5*v];s.high^=p,s.low^=b}for(var k=1;k<25;k++){var s=r[k],x=s.high,S=s.low,A=c[k];if(A<32)var p=x<>>32-A,b=S<>>32-A;else var p=S<>>64-A,b=x<>>64-A;var M=l[u[k]];M.high=p,M.low=b}var E=l[0],C=r[0];E.high=C.high,E.low=C.low;for(var h=0;h<5;h++)for(var v=0;v<5;v++){var k=h+5*v,s=r[k],I=l[k],T=l[(h+1)%5+5*v],P=l[(h+2)%5+5*v];s.high=I.high^~T.high&P.high,s.low=I.low^~T.low&P.low}var s=r[0],R=d[f];s.high^=R.high,s.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,f=s/8,c=[],u=0;u>>24)|4278255360&(l<<24|l>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),c.push(h),c.push(l)}return new i.init(c,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(h),r.HmacSHA3=a._createHmacHelper(h)}(Math),e.SHA3})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){/** @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: @@ -19,4 +19,4 @@ return e.mode.CTRGladman=function(){function t(e){if(255==(e>>24&255)){var t=e>> * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},function(e,t,r){"use strict";function n(e){this.defaults=e,this.interceptors={request:new o,response:new o}}var i=r(33),a=r(5),o=r(161),s=r(162);n.prototype.request=function(e){"string"==typeof e&&(e=a.merge({url:arguments[0]},arguments[1])),e=a.merge(i,this.defaults,{method:"get"},e),e.method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},a.forEach(["delete","get","head","options"],function(e){n.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))}}),a.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=n},function(e,t,r){"use strict";var n=r(5);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(5),i=r(57),a=r(59),o=r(146),s=r(147),f=r(34),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(148);e.exports=function(e){return new Promise(function(t,u){var d=e.data,l=e.headers;n.isFormData(d)&&delete l["Content-Type"];var h=new XMLHttpRequest,p="onreadystatechange",b=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(e.url)||(h=new window.XDomainRequest,p="onload",b=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var v=e.auth.username||"",m=e.auth.password||"";l.Authorization="Basic "+c(v+":"+m)}if(h.open(e.method.toUpperCase(),a(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[p]=function(){if(h&&(4===h.readyState||b)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?o(h.getAllResponseHeaders()):null,n=e.responseType&&"text"!==e.responseType?h.response:h.responseText,a={data:n,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:r,config:e,request:h};i(t,u,a),h=null}},h.onerror=function(){u(f("Network Error",e,null,h)),h=null},h.ontimeout=function(){u(f("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var g=r(149),y=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in h&&n.forEach(l,function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete l[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),u(e),h=null)}),void 0===d&&(d=null),h.send(d)})}},function(e,t,r){"use strict";var n=r(5),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}}),o):o}},function(e,t,r){"use strict";var n=r(5);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(r){var i=n.isString(r)?e(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";function n(){this.message="String contains an invalid character"}function i(e){for(var t,r,i=String(e),o="",s=0,f=a;i.charAt(0|s)||(f="=",s%1);o+=f.charAt(63&t>>8-s%1*8)){if((r=i.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return o}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=i},function(e,t,r){"use strict";var n=r(5);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";var n=r(5),i=r(57),a=r(59),o=r(60),s=r(61),f=r(62).http,c=r(62).https,u=r(63),d=r(159),l=r(160),h=r(34),p=r(58);e.exports=function(e){return new Promise(function(t,r){var b,v=e.data,m=e.headers;if(m["User-Agent"]||m["user-agent"]||(m["User-Agent"]="axios/"+l.version),v&&!n.isStream(v)){if(Buffer.isBuffer(v));else if(n.isArrayBuffer(v))v=new Buffer(new Uint8Array(v));else{if(!n.isString(v))return r(h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));v=new Buffer(v,"utf-8")}m["Content-Length"]=v.length}var g=void 0;if(e.auth){g=(e.auth.username||"")+":"+(e.auth.password||"")}var y=u.parse(e.url),w=y.protocol||"http:";if(!g&&y.auth){var _=y.auth.split(":");g=(_[0]||"")+":"+(_[1]||"")}g&&delete m.Authorization;var k="https:"===w,x=k?e.httpsAgent:e.httpAgent,S={hostname:y.hostname,port:y.port,path:a(y.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method,headers:m,agent:x,auth:g},A=e.proxy;if(!A&&!1!==A){var M=w.slice(0,-1)+"_proxy",E=Object({NODE_ENV:"production"})[M]||Object({NODE_ENV:"production"})[M.toUpperCase()];if(E){var C=u.parse(E);if(A={host:C.hostname,port:C.port},C.auth){var I=C.auth.split(":");A.auth={username:I[0],password:I[1]}}}}if(A&&(S.hostname=A.host,S.host=A.host,S.headers.host=y.hostname+(y.port?":"+y.port:""),S.port=A.port,S.path=w+"//"+y.hostname+(y.port?":"+y.port:"")+S.path,A.auth)){var T=new Buffer(A.auth.username+":"+A.auth.password,"utf8").toString("base64");S.headers["Proxy-Authorization"]="Basic "+T}var P;e.transport?P=e.transport:0===e.maxRedirects?P=k?s:o:(e.maxRedirects&&(S.maxRedirects=e.maxRedirects),P=k?c:f);var R=P.request(S,function(n){if(!R.aborted){clearTimeout(b),b=null;var a=n;switch(n.headers["content-encoding"]){case"gzip":case"compress":case"deflate":a=a.pipe(d.createUnzip()),delete n.headers["content-encoding"]}var o=n.req||R,s={status:n.statusCode,statusText:n.statusMessage,headers:n.headers,config:e,request:o};if("stream"===e.responseType)s.data=a,i(t,r,s);else{var f=[];a.on("data",function(t){f.push(t),e.maxContentLength>-1&&Buffer.concat(f).length>e.maxContentLength&&r(h("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,o))}),a.on("error",function(t){R.aborted||r(p(t,e,null,o))}),a.on("end",function(){var n=Buffer.concat(f);"arraybuffer"!==e.responseType&&(n=n.toString("utf8")),s.data=n,i(t,r,s)})}}});R.on("error",function(t){R.aborted||r(p(t,e,null,R))}),e.timeout&&!b&&(b=setTimeout(function(){R.abort(),r(h("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",R))},e.timeout)),e.cancelToken&&e.cancelToken.promise.then(function(e){R.aborted||(R.abort(),r(e))}),n.isStream(v)?v.pipe(R):R.end(v)})}},function(e,t){e.exports=require("assert")},function(e,t){e.exports=require("stream")},function(e,t,r){"undefined"==typeof process||"renderer"===process.type?e.exports=r(154):e.exports=r(156)},function(e,t,r){function n(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))}),e.splice(a,0,n)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function s(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=Object({NODE_ENV:"production"}).DEBUG),e}t=e.exports=r(64),t.log=a,t.formatArgs=i,t.save=o,t.load=s,t.useColors=n,t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(s())},function(e,t){function r(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*u;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*f;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=c?Math.round(e/c)+"d":e>=f?Math.round(e/f)+"h":e>=s?Math.round(e/s)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}function i(e){return a(e,c,"day")||a(e,f,"hour")||a(e,s,"minute")||a(e,o,"second")||e+" ms"}function a(e,t,r){if(!(e0)return r(e);if("number"===a&&!1===isNaN(e))return t.long?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):u.isatty(process.stderr.fd)}function i(e){var r=this.namespace;if(this.useColors){var n=this.color,i="[3"+(n<8?n:"8;5;"+n),o=" "+i+";1m"+r+" ";e[0]=o+e[0].split("\n").join("\n"+o),e.push(i+"m+"+t.humanize(this.diff)+"")}else e[0]=a()+r+" "+e[0]}function a(){return t.inspectOpts.hideDate?"":(new Date).toISOString()+" "}function o(){return process.stderr.write(d.format.apply(d,arguments)+"\n")}function s(e){null==e?delete Object({NODE_ENV:"production"}).DEBUG:Object({NODE_ENV:"production"}).DEBUG=e}function f(){return Object({NODE_ENV:"production"}).DEBUG}function c(e){e.inspectOpts={};for(var r=Object.keys(t.inspectOpts),n=0;n=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(Object({NODE_ENV:"production"})).filter(function(e){return/^debug_/i.test(e)}).reduce(function(e,t){var r=t.substring(6).toLowerCase().replace(/_([a-z])/g,function(e,t){return t.toUpperCase()}),n=Object({NODE_ENV:"production"})[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),t.formatters.o=function(e){return this.inspectOpts.colors=this.useColors,d.inspect(e,this.inspectOpts).split("\n").map(function(e){return e.trim()}).join(" ")},t.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,d.inspect(e,this.inspectOpts)},t.enable(f())},function(e,t){e.exports=require("tty")},function(e,t,r){"use strict";var n=process.argv,i=n.indexOf("--"),a=function(e){e="--"+e;var t=n.indexOf(e);return-1!==t&&(-1===i||tQ)return null;if(!(t?J[ve]:J[he]).test(e))return null;try{return new o(e,t)}catch(e){return null}}function i(e,t){var r=n(e,t);return r?r.version:null}function a(e,t){var r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}function o(e,t){if(e instanceof o){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>Q)throw new TypeError("version is longer than "+Q+" characters");if(!(this instanceof o))return new o(e,t);G("SemVer",e,t),this.loose=t;var r=e.trim().match(t?J[ve]:J[he]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>$||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<$)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new o(e,r).inc(t,n).version}catch(e){return null}}function f(e,t){if(_(e,t))return null;var r=n(e),i=n(t);if(r.prerelease.length||i.prerelease.length){for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return"pre"+a;return"prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return a}function c(e,t){var r=qe.test(e),n=qe.test(t);return r&&n&&(e=+e,t=+t),r&&!n?-1:n&&!r?1:et?1:0}function u(e,t){return c(t,e)}function d(e,t){return new o(e,t).major}function l(e,t){return new o(e,t).minor}function h(e,t){return new o(e,t).patch}function p(e,t,r){return new o(e,r).compare(new o(t,r))}function b(e,t){return p(e,t,!0)}function v(e,t,r){return p(t,e,r)}function m(e,r){return e.sort(function(e,n){return t.compare(e,n,r)})}function g(e,r){return e.sort(function(e,n){return t.rcompare(e,n,r)})}function y(e,t,r){return p(e,t,r)>0}function w(e,t,r){return p(e,t,r)<0}function _(e,t,r){return 0===p(e,t,r)}function k(e,t,r){return 0!==p(e,t,r)}function x(e,t,r){return p(e,t,r)>=0}function S(e,t,r){return p(e,t,r)<=0}function A(e,t,r,n){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e===r;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e!==r;break;case"":case"=":case"==":i=_(e,r,n);break;case"!=":i=k(e,r,n);break;case">":i=y(e,r,n);break;case">=":i=x(e,r,n);break;case"<":i=w(e,r,n);break;case"<=":i=S(e,r,n);break;default:throw new TypeError("Invalid operator: "+t)}return i}function M(e,t){if(e instanceof M){if(e.loose===t)return e;e=e.value}if(!(this instanceof M))return new M(e,t);G("comparator",e,t),this.loose=t,this.parse(e),this.semver===Le?this.value="":this.value=this.operator+this.semver.version,G("comp",this)}function E(e,t){if(e instanceof E)return e.loose===t?e:new E(e.raw,t);if(e instanceof M)return new E(e.value,t);if(!(this instanceof E))return new E(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function C(e,t){return new E(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function I(e,t){return G("comp",e),e=B(e,t),G("caret",e),e=P(e,t),G("tildes",e),e=N(e,t),G("xrange",e),e=j(e,t),G("stars",e),e}function T(e){return!e||"x"===e.toLowerCase()||"*"===e}function P(e,t){return e.trim().split(/\s+/).map(function(e){return R(e,t)}).join(" ")}function R(e,t){var r=t?J[Ce]:J[Ee];return e.replace(r,function(t,r,n,i,a){G("tilde",e,t,r,n,i,a);var o;return T(r)?o="":T(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":T(i)?o=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":a?(G("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),o=">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0"):o=">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0",G("tilde return",o),o})}function B(e,t){return e.trim().split(/\s+/).map(function(e){return O(e,t)}).join(" ")}function O(e,t){G("caret",e,t);var r=t?J[Re]:J[Pe];return e.replace(r,function(t,r,n,i,a){G("caret",e,t,r,n,i,a);var o;return T(r)?o="":T(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":T(i)?o="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":a?(G("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),o="0"===r?"0"===n?">="+r+"."+n+"."+i+a+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+a+" <"+(+r+1)+".0.0"):(G("no pr"),o="0"===r?"0"===n?">="+r+"."+n+"."+i+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+" <"+(+r+1)+".0.0"),G("caret return",o),o})}function N(e,t){return G("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return F(e,t)}).join(" ")}function F(e,t){e=e.trim();var r=t?J[xe]:J[ke];return e.replace(r,function(t,r,n,i,a,o){G("xRange",e,t,r,n,i,a,o);var s=T(n),f=s||T(i),c=f||T(a),u=c;return"="===r&&u&&(r=""),s?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(f&&(i=0),c&&(a=0),">"===r?(r=">=",f?(n=+n+1,i=0,a=0):c&&(i=+i+1,a=0)):"<="===r&&(r="<",f?n=+n+1:i=+i+1),t=r+n+"."+i+"."+a):f?t=">="+n+".0.0 <"+(+n+1)+".0.0":c&&(t=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),G("xRange return",t),t})}function j(e,t){return G("replaceStars",e,t),e.trim().replace(J[ze],"")}function z(e,t,r,n,i,a,o,s,f,c,u,d,l){return t=T(r)?"":T(n)?">="+r+".0.0":T(i)?">="+r+"."+n+".0":">="+t,s=T(f)?"":T(c)?"<"+(+f+1)+".0.0":T(u)?"<"+f+"."+(+c+1)+".0":d?"<="+f+"."+c+"."+u+"-"+d:"<="+s,(t+" "+s).trim()}function H(e,t){for(var r=0;r0){var n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}function q(e,t,r){try{t=new E(t,r)}catch(e){return!1}return t.test(e)}function L(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function D(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function U(e,t){try{return new E(e,t).range||"*"}catch(e){return null}}function K(e,t,r){return Y(e,t,"<",r)}function V(e,t,r){return Y(e,t,">",r)}function Y(e,t,r,n){e=new o(e,n),t=new E(t,n);var i,a,s,f,c;switch(r){case">":i=y,a=S,s=w,f=">",c=">=";break;case"<":i=w,a=x,s=y,f="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(q(e,t,n))return!1;for(var u=0;u=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,n)?l=e:s(e.semver,h.semver,n)&&(h=e)}),l.operator===f||l.operator===c)return!1;if((!h.operator||h.operator===f)&&a(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0}function W(e,t){var r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}function X(e,t,r){return e=new E(e,r),t=new E(t,r),e.intersects(t)}function Z(e){if(e instanceof o)return e;if("string"!=typeof e)return null;var t=e.match(J[Se]);return null==t?null:n((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}t=e.exports=o;var G;G="object"==typeof process&&Object({NODE_ENV:"production"})&&Object({NODE_ENV:"production"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production"}).NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var Q=256,$=Number.MAX_SAFE_INTEGER||9007199254740991,J=t.re=[],ee=t.src=[],te=0,re=te++;ee[re]="0|[1-9]\\d*";var ne=te++;ee[ne]="[0-9]+";var ie=te++;ee[ie]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var ae=te++;ee[ae]="("+ee[re]+")\\.("+ee[re]+")\\.("+ee[re]+")";var oe=te++;ee[oe]="("+ee[ne]+")\\.("+ee[ne]+")\\.("+ee[ne]+")";var se=te++;ee[se]="(?:"+ee[re]+"|"+ee[ie]+")";var fe=te++;ee[fe]="(?:"+ee[ne]+"|"+ee[ie]+")";var ce=te++;ee[ce]="(?:-("+ee[se]+"(?:\\."+ee[se]+")*))";var ue=te++;ee[ue]="(?:-?("+ee[fe]+"(?:\\."+ee[fe]+")*))";var de=te++;ee[de]="[0-9A-Za-z-]+";var le=te++;ee[le]="(?:\\+("+ee[de]+"(?:\\."+ee[de]+")*))";var he=te++,pe="v?"+ee[ae]+ee[ce]+"?"+ee[le]+"?";ee[he]="^"+pe+"$";var be="[v=\\s]*"+ee[oe]+ee[ue]+"?"+ee[le]+"?",ve=te++;ee[ve]="^"+be+"$";var me=te++;ee[me]="((?:<|>)?=?)";var ge=te++;ee[ge]=ee[ne]+"|x|X|\\*";var ye=te++;ee[ye]=ee[re]+"|x|X|\\*";var we=te++;ee[we]="[v=\\s]*("+ee[ye]+")(?:\\.("+ee[ye]+")(?:\\.("+ee[ye]+")(?:"+ee[ce]+")?"+ee[le]+"?)?)?";var _e=te++;ee[_e]="[v=\\s]*("+ee[ge]+")(?:\\.("+ee[ge]+")(?:\\.("+ee[ge]+")(?:"+ee[ue]+")?"+ee[le]+"?)?)?";var ke=te++;ee[ke]="^"+ee[me]+"\\s*"+ee[we]+"$";var xe=te++;ee[xe]="^"+ee[me]+"\\s*"+ee[_e]+"$";var Se=te++;ee[Se]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Ae=te++;ee[Ae]="(?:~>?)";var Me=te++;ee[Me]="(\\s*)"+ee[Ae]+"\\s+",J[Me]=new RegExp(ee[Me],"g");var Ee=te++;ee[Ee]="^"+ee[Ae]+ee[we]+"$";var Ce=te++;ee[Ce]="^"+ee[Ae]+ee[_e]+"$";var Ie=te++;ee[Ie]="(?:\\^)";var Te=te++;ee[Te]="(\\s*)"+ee[Ie]+"\\s+",J[Te]=new RegExp(ee[Te],"g");var Pe=te++;ee[Pe]="^"+ee[Ie]+ee[we]+"$";var Re=te++;ee[Re]="^"+ee[Ie]+ee[_e]+"$";var Be=te++;ee[Be]="^"+ee[me]+"\\s*("+be+")$|^$";var Oe=te++;ee[Oe]="^"+ee[me]+"\\s*("+pe+")$|^$";var Ne=te++;ee[Ne]="(\\s*)"+ee[me]+"\\s*("+be+"|"+ee[we]+")",J[Ne]=new RegExp(ee[Ne],"g");var Fe=te++;ee[Fe]="^\\s*("+ee[we]+")\\s+-\\s+("+ee[we]+")\\s*$";var je=te++;ee[je]="^\\s*("+ee[_e]+")\\s+-\\s+("+ee[_e]+")\\s*$";var ze=te++;ee[ze]="(<|>)?=?\\s*\\*";for(var He=0;He=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=s,t.diff=f,t.compareIdentifiers=c;var qe=/^[0-9]+$/;t.rcompareIdentifiers=u,t.major=d,t.minor=l,t.patch=h,t.compare=p,t.compareLoose=b,t.rcompare=v,t.sort=m,t.rsort=g,t.gt=y,t.lt=w,t.eq=_,t.neq=k,t.gte=x,t.lte=S,t.cmp=A,t.Comparator=M;var Le={};M.prototype.parse=function(e){var t=this.loose?J[Be]:J[Oe],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new o(r[2],this.loose):this.semver=Le},M.prototype.toString=function(){return this.value},M.prototype.test=function(e){return G("Comparator.test",e,this.loose),this.semver===Le||("string"==typeof e&&(e=new o(e,this.loose)),A(e,this.operator,this.semver,this.loose))},M.prototype.intersects=function(e,t){if(!(e instanceof M))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new E(e.value,t),q(this.value,r,t);if(""===e.operator)return r=new E(this.value,t),q(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),a=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=A(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),f=A(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||a&&o||s||f},t.Range=E,E.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),G("range",e,t);var r=t?J[je]:J[Fe];e=e.replace(r,z),G("hyphen replace",e),e=e.replace(J[Ne],"$1$2$3"),G("comparator trim",e,J[Ne]),e=e.replace(J[Me],"$1~"),e=e.replace(J[Te],"$1^"),e=e.split(/\s+/).join(" ");var n=t?J[Be]:J[Oe],i=e.split(" ").map(function(e){return I(e,t)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(e){return!!e.match(n)})),i=i.map(function(e){return new M(e,t)})},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return e.set.some(function(e){return e.every(function(e){return r.intersects(e,t)})})})})},t.toComparators=C,E.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new o(e,this.loose));for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:u.DEFAULT_WALLET,r=t.name,n=void 0===r?"myWallet":r,a=t.version,o=void 0===a?u.DEFAULT_WALLET.version:a,s=t.scrypt,f=void 0===s?{}:s,c=t.accounts,d=void 0===c?[]:c,l=t.extra,p=void 0===l?null:l;i(this,e),this.name=n,this.version=o,this.scrypt=f,this.accounts=[];var b=!0,v=!1,m=void 0;try{for(var g,y=d[Symbol.iterator]();!(b=(g=y.next()).done);b=!0){var w=g.value;this.addAccount(w)}}catch(e){v=!0,m=e}finally{try{!b&&y.return&&y.return()}finally{if(v)throw m}}this.extra=p,h.info("New Wallet created: "+this.name)}return a(e,[{key:"addAccount",value:function(e){var t=this.accounts.length;e instanceof c.default||(e=new c.default(e)),this.accounts.push(e);try{var r=e.address;h.info("Added Account: "+r+" to Wallet "+this.name)}catch(e){h.warn("Encrypted account added to Wallet "+this.name+". You will not be able to export this wallet without first decrypting this account")}return t}},{key:"decrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].decrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"decryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.decrypt(i,e))}),h.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"encrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].encrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"encryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.encrypt(i,e))}),h.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"export",value:function(){return{name:this.name,version:this.version,scrypt:this.scrypt,accounts:this.accounts.map(function(e){return e.export()}),extra:this.extra}}},{key:"setDefault",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=t.address||"",this.net=t.net||"NoNet",this.claims=t.claims?t.claims.map(function(e){return(0,a.ClaimItem)(e)}):[]}return i(e,[{key:s.default.inspect.custom,value:function(e,t){var r=this.claims.map(function(e){return e.txid+" <"+e.index+">: "+e.claim.toString()});return"[Claims("+this.net+"): "+this.address+"]\n"+JSON.stringify(r,null,2)}},{key:"export",value:function(){return{address:this.address,net:this.net,claims:this.claims.map(c)}}},{key:"slice",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new e({address:this.address,net:this.net,claims:this.claims.slice(t,r)})}},{key:Symbol.toStringTag,get:function(){return"Claims"}}]),e}();t.default=f;var c=function(e){return{claim:e.claim.toNumber(),txid:e.txid,index:e.index,value:e.value,start:e.start?e.start.toNumber():null,end:e.end?e.end.toNumber():null}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"NEO",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd";return h.warn("This is deprecated in favor of getPrices. There is a known bug for NEP5 tokens with this function."),o("https://api.coinmarketcap.com/v1/ticker/"+e.toLowerCase()+"/",t).then(function(t){var r=t[e.toUpperCase()];if(r)return r;throw new Error("Something went wrong with the CoinMarketCap API!")}).catch(function(e){throw h.error(e.message),e})},t.getPrices=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["NEO"];return o("https://api.coinmarketcap.com/v1/ticker/",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd").then(function(t){e=e.map(function(e){return e.toUpperCase()});var r=f.apply(void 0,[t].concat(a(e)));if(e.some(function(e){return!r[e]}))throw new Error("None of the coin symbols are supported by CoinMarketCap!");return r}).catch(function(e){throw h.error(e.message),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTransferToken=t.getToken=t.getTokenBalance=t.getTokenInfo=void 0;var n=r(32),i=r(7),a=r(17),o=r(1),s=r(35),f=r(14),c=r(3),u=r(4),d=function(e){return e&&e.__esModule?e:{default:e}}(u),l=(0,d.default)("api"),h=function(e){return""===e?0:parseInt(e,10)},p=function(e){return e?parseInt((0,o.reverseHex)(e),16):0},b=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,h,p),v=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,h,p,p);t.getTokenInfo=function(e,t){var r=new n.ScriptBuilder;r.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply");var i=r.str;return a.Query.invokeScript(i,!1).parseWith(b).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2])}}).catch(function(e){throw l.error("getTokenInfo failed with : "+e.message),e})},t.getTokenBalance=function(e,t,r){var s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r)),f=new n.ScriptBuilder,c=f.emitAppCall(t,"decimals").emitAppCall(t,"balanceOf",[s]).str;return a.Query.invokeScript(c,!1).execute(e).then(function(e){try{var t=h(e.result.stack[0].value);return p(e.result.stack[1].value)/Math.pow(10,t)}catch(e){return 0}}).catch(function(e){throw l.error("getTokenBalance failed with : "+e.message),e})},t.getToken=function(e,t,r){var s=r?v:b,f=new n.ScriptBuilder;if(f.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply"),r){var c=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r));f.emitAppCall(t,"balanceOf",[c])}var u=f.str;return a.Query.invokeScript(u,!1).parseWith(s).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2]),balance:5===e.length?e[4]/Math.pow(10,e[2]):null}}).catch(function(e){throw l.error("getToken failed with : "+e.message),e})},t.doTransferToken=function(e,t,r,n,u){var d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;l.warn("doTransferToken will be deprecated in favor of doInvoke");var p=new i.Account(r),b=(0,s.getRPCEndpoint)(e),v=(0,s.getBalance)(e,p.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var r=e[1],a=(0,i.getScriptHashFromAddress)(p.address),s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(n)),l=[{assetId:c.ASSET_ID.GAS,value:1e-8,scriptHash:a}],b={scriptHash:t,operation:"transfer",args:[(0,o.reverseHex)(a),s,u]},v=f.Transaction.createInvocationTx(r,l,b,d,{version:1});return h?h(v,p.publicKey):v.sign(p.privateKey)}).then(function(e){return m=e,a.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})}}])}); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},function(e,t,r){"use strict";function n(e){this.defaults=e,this.interceptors={request:new o,response:new o}}var i=r(33),a=r(5),o=r(161),s=r(162);n.prototype.request=function(e){"string"==typeof e&&(e=a.merge({url:arguments[0]},arguments[1])),e=a.merge(i,this.defaults,{method:"get"},e),e.method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},a.forEach(["delete","get","head","options"],function(e){n.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))}}),a.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=n},function(e,t,r){"use strict";var n=r(5);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(5),i=r(57),a=r(59),o=r(146),s=r(147),f=r(34),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(148);e.exports=function(e){return new Promise(function(t,u){var d=e.data,l=e.headers;n.isFormData(d)&&delete l["Content-Type"];var h=new XMLHttpRequest,p="onreadystatechange",b=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(e.url)||(h=new window.XDomainRequest,p="onload",b=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var v=e.auth.username||"",m=e.auth.password||"";l.Authorization="Basic "+c(v+":"+m)}if(h.open(e.method.toUpperCase(),a(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[p]=function(){if(h&&(4===h.readyState||b)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?o(h.getAllResponseHeaders()):null,n=e.responseType&&"text"!==e.responseType?h.response:h.responseText,a={data:n,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:r,config:e,request:h};i(t,u,a),h=null}},h.onerror=function(){u(f("Network Error",e,null,h)),h=null},h.ontimeout=function(){u(f("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var g=r(149),y=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in h&&n.forEach(l,function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete l[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),u(e),h=null)}),void 0===d&&(d=null),h.send(d)})}},function(e,t,r){"use strict";var n=r(5),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}}),o):o}},function(e,t,r){"use strict";var n=r(5);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(r){var i=n.isString(r)?e(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return function(){return!0}}()},function(e,t,r){"use strict";function n(){this.message="String contains an invalid character"}function i(e){for(var t,r,i=String(e),o="",s=0,f=a;i.charAt(0|s)||(f="=",s%1);o+=f.charAt(63&t>>8-s%1*8)){if((r=i.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return o}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=i},function(e,t,r){"use strict";var n=r(5);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";var n=r(5),i=r(57),a=r(59),o=r(60),s=r(61),f=r(62).http,c=r(62).https,u=r(63),d=r(159),l=r(160),h=r(34),p=r(58);e.exports=function(e){return new Promise(function(t,r){var b,v=e.data,m=e.headers;if(m["User-Agent"]||m["user-agent"]||(m["User-Agent"]="axios/"+l.version),v&&!n.isStream(v)){if(Buffer.isBuffer(v));else if(n.isArrayBuffer(v))v=new Buffer(new Uint8Array(v));else{if(!n.isString(v))return r(h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));v=new Buffer(v,"utf-8")}m["Content-Length"]=v.length}var g=void 0;if(e.auth){g=(e.auth.username||"")+":"+(e.auth.password||"")}var y=u.parse(e.url),w=y.protocol||"http:";if(!g&&y.auth){var _=y.auth.split(":");g=(_[0]||"")+":"+(_[1]||"")}g&&delete m.Authorization;var k="https:"===w,x=k?e.httpsAgent:e.httpAgent,S={hostname:y.hostname,port:y.port,path:a(y.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method,headers:m,agent:x,auth:g},A=e.proxy;if(!A&&!1!==A){var M=w.slice(0,-1)+"_proxy",E=Object({NODE_ENV:"production"})[M]||Object({NODE_ENV:"production"})[M.toUpperCase()];if(E){var C=u.parse(E);if(A={host:C.hostname,port:C.port},C.auth){var I=C.auth.split(":");A.auth={username:I[0],password:I[1]}}}}if(A&&(S.hostname=A.host,S.host=A.host,S.headers.host=y.hostname+(y.port?":"+y.port:""),S.port=A.port,S.path=w+"//"+y.hostname+(y.port?":"+y.port:"")+S.path,A.auth)){var T=new Buffer(A.auth.username+":"+A.auth.password,"utf8").toString("base64");S.headers["Proxy-Authorization"]="Basic "+T}var P;e.transport?P=e.transport:0===e.maxRedirects?P=k?s:o:(e.maxRedirects&&(S.maxRedirects=e.maxRedirects),P=k?c:f);var R=P.request(S,function(n){if(!R.aborted){clearTimeout(b),b=null;var a=n;switch(n.headers["content-encoding"]){case"gzip":case"compress":case"deflate":a=a.pipe(d.createUnzip()),delete n.headers["content-encoding"]}var o=n.req||R,s={status:n.statusCode,statusText:n.statusMessage,headers:n.headers,config:e,request:o};if("stream"===e.responseType)s.data=a,i(t,r,s);else{var f=[];a.on("data",function(t){f.push(t),e.maxContentLength>-1&&Buffer.concat(f).length>e.maxContentLength&&r(h("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,o))}),a.on("error",function(t){R.aborted||r(p(t,e,null,o))}),a.on("end",function(){var n=Buffer.concat(f);"arraybuffer"!==e.responseType&&(n=n.toString("utf8")),s.data=n,i(t,r,s)})}}});R.on("error",function(t){R.aborted||r(p(t,e,null,R))}),e.timeout&&!b&&(b=setTimeout(function(){R.abort(),r(h("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",R))},e.timeout)),e.cancelToken&&e.cancelToken.promise.then(function(e){R.aborted||(R.abort(),r(e))}),n.isStream(v)?v.pipe(R):R.end(v)})}},function(e,t){e.exports=require("assert")},function(e,t){e.exports=require("stream")},function(e,t,r){"undefined"==typeof process||"renderer"===process.type?e.exports=r(154):e.exports=r(156)},function(e,t,r){function n(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))}),e.splice(a,0,n)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function s(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=Object({NODE_ENV:"production"}).DEBUG),e}t=e.exports=r(64),t.log=a,t.formatArgs=i,t.save=o,t.load=s,t.useColors=n,t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(s())},function(e,t){function r(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*u;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*f;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=c?Math.round(e/c)+"d":e>=f?Math.round(e/f)+"h":e>=s?Math.round(e/s)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}function i(e){return a(e,c,"day")||a(e,f,"hour")||a(e,s,"minute")||a(e,o,"second")||e+" ms"}function a(e,t,r){if(!(e0)return r(e);if("number"===a&&!1===isNaN(e))return t.long?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):u.isatty(process.stderr.fd)}function i(e){var r=this.namespace;if(this.useColors){var n=this.color,i="[3"+(n<8?n:"8;5;"+n),o=" "+i+";1m"+r+" ";e[0]=o+e[0].split("\n").join("\n"+o),e.push(i+"m+"+t.humanize(this.diff)+"")}else e[0]=a()+r+" "+e[0]}function a(){return t.inspectOpts.hideDate?"":(new Date).toISOString()+" "}function o(){return process.stderr.write(d.format.apply(d,arguments)+"\n")}function s(e){null==e?delete Object({NODE_ENV:"production"}).DEBUG:Object({NODE_ENV:"production"}).DEBUG=e}function f(){return Object({NODE_ENV:"production"}).DEBUG}function c(e){e.inspectOpts={};for(var r=Object.keys(t.inspectOpts),n=0;n=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(Object({NODE_ENV:"production"})).filter(function(e){return/^debug_/i.test(e)}).reduce(function(e,t){var r=t.substring(6).toLowerCase().replace(/_([a-z])/g,function(e,t){return t.toUpperCase()}),n=Object({NODE_ENV:"production"})[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),t.formatters.o=function(e){return this.inspectOpts.colors=this.useColors,d.inspect(e,this.inspectOpts).split("\n").map(function(e){return e.trim()}).join(" ")},t.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,d.inspect(e,this.inspectOpts)},t.enable(f())},function(e,t){e.exports=require("tty")},function(e,t,r){"use strict";var n=process.argv,i=n.indexOf("--"),a=function(e){e="--"+e;var t=n.indexOf(e);return-1!==t&&(-1===i||tQ)return null;if(!(t?J[ve]:J[he]).test(e))return null;try{return new o(e,t)}catch(e){return null}}function i(e,t){var r=n(e,t);return r?r.version:null}function a(e,t){var r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}function o(e,t){if(e instanceof o){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>Q)throw new TypeError("version is longer than "+Q+" characters");if(!(this instanceof o))return new o(e,t);G("SemVer",e,t),this.loose=t;var r=e.trim().match(t?J[ve]:J[he]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>$||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<$)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new o(e,r).inc(t,n).version}catch(e){return null}}function f(e,t){if(_(e,t))return null;var r=n(e),i=n(t);if(r.prerelease.length||i.prerelease.length){for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return"pre"+a;return"prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==i[a])return a}function c(e,t){var r=qe.test(e),n=qe.test(t);return r&&n&&(e=+e,t=+t),r&&!n?-1:n&&!r?1:et?1:0}function u(e,t){return c(t,e)}function d(e,t){return new o(e,t).major}function l(e,t){return new o(e,t).minor}function h(e,t){return new o(e,t).patch}function p(e,t,r){return new o(e,r).compare(new o(t,r))}function b(e,t){return p(e,t,!0)}function v(e,t,r){return p(t,e,r)}function m(e,r){return e.sort(function(e,n){return t.compare(e,n,r)})}function g(e,r){return e.sort(function(e,n){return t.rcompare(e,n,r)})}function y(e,t,r){return p(e,t,r)>0}function w(e,t,r){return p(e,t,r)<0}function _(e,t,r){return 0===p(e,t,r)}function k(e,t,r){return 0!==p(e,t,r)}function x(e,t,r){return p(e,t,r)>=0}function S(e,t,r){return p(e,t,r)<=0}function A(e,t,r,n){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e===r;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),i=e!==r;break;case"":case"=":case"==":i=_(e,r,n);break;case"!=":i=k(e,r,n);break;case">":i=y(e,r,n);break;case">=":i=x(e,r,n);break;case"<":i=w(e,r,n);break;case"<=":i=S(e,r,n);break;default:throw new TypeError("Invalid operator: "+t)}return i}function M(e,t){if(e instanceof M){if(e.loose===t)return e;e=e.value}if(!(this instanceof M))return new M(e,t);G("comparator",e,t),this.loose=t,this.parse(e),this.semver===Le?this.value="":this.value=this.operator+this.semver.version,G("comp",this)}function E(e,t){if(e instanceof E)return e.loose===t?e:new E(e.raw,t);if(e instanceof M)return new E(e.value,t);if(!(this instanceof E))return new E(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function C(e,t){return new E(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function I(e,t){return G("comp",e),e=B(e,t),G("caret",e),e=P(e,t),G("tildes",e),e=N(e,t),G("xrange",e),e=j(e,t),G("stars",e),e}function T(e){return!e||"x"===e.toLowerCase()||"*"===e}function P(e,t){return e.trim().split(/\s+/).map(function(e){return R(e,t)}).join(" ")}function R(e,t){var r=t?J[Ce]:J[Ee];return e.replace(r,function(t,r,n,i,a){G("tilde",e,t,r,n,i,a);var o;return T(r)?o="":T(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":T(i)?o=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":a?(G("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),o=">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0"):o=">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0",G("tilde return",o),o})}function B(e,t){return e.trim().split(/\s+/).map(function(e){return O(e,t)}).join(" ")}function O(e,t){G("caret",e,t);var r=t?J[Re]:J[Pe];return e.replace(r,function(t,r,n,i,a){G("caret",e,t,r,n,i,a);var o;return T(r)?o="":T(n)?o=">="+r+".0.0 <"+(+r+1)+".0.0":T(i)?o="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":a?(G("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),o="0"===r?"0"===n?">="+r+"."+n+"."+i+a+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+a+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+a+" <"+(+r+1)+".0.0"):(G("no pr"),o="0"===r?"0"===n?">="+r+"."+n+"."+i+" <"+r+"."+n+"."+(+i+1):">="+r+"."+n+"."+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+i+" <"+(+r+1)+".0.0"),G("caret return",o),o})}function N(e,t){return G("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return F(e,t)}).join(" ")}function F(e,t){e=e.trim();var r=t?J[xe]:J[ke];return e.replace(r,function(t,r,n,i,a,o){G("xRange",e,t,r,n,i,a,o);var s=T(n),f=s||T(i),c=f||T(a),u=c;return"="===r&&u&&(r=""),s?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(f&&(i=0),c&&(a=0),">"===r?(r=">=",f?(n=+n+1,i=0,a=0):c&&(i=+i+1,a=0)):"<="===r&&(r="<",f?n=+n+1:i=+i+1),t=r+n+"."+i+"."+a):f?t=">="+n+".0.0 <"+(+n+1)+".0.0":c&&(t=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),G("xRange return",t),t})}function j(e,t){return G("replaceStars",e,t),e.trim().replace(J[ze],"")}function z(e,t,r,n,i,a,o,s,f,c,u,d,l){return t=T(r)?"":T(n)?">="+r+".0.0":T(i)?">="+r+"."+n+".0":">="+t,s=T(f)?"":T(c)?"<"+(+f+1)+".0.0":T(u)?"<"+f+"."+(+c+1)+".0":d?"<="+f+"."+c+"."+u+"-"+d:"<="+s,(t+" "+s).trim()}function H(e,t){for(var r=0;r0){var n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}function q(e,t,r){try{t=new E(t,r)}catch(e){return!1}return t.test(e)}function L(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function D(e,t,r){var n=null,i=null;try{var a=new E(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new o(n,r)))}),n}function U(e,t){try{return new E(e,t).range||"*"}catch(e){return null}}function K(e,t,r){return Y(e,t,"<",r)}function V(e,t,r){return Y(e,t,">",r)}function Y(e,t,r,n){e=new o(e,n),t=new E(t,n);var i,a,s,f,c;switch(r){case">":i=y,a=S,s=w,f=">",c=">=";break;case"<":i=w,a=x,s=y,f="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(q(e,t,n))return!1;for(var u=0;u=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,n)?l=e:s(e.semver,h.semver,n)&&(h=e)}),l.operator===f||l.operator===c)return!1;if((!h.operator||h.operator===f)&&a(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0}function W(e,t){var r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}function X(e,t,r){return e=new E(e,r),t=new E(t,r),e.intersects(t)}function Z(e){if(e instanceof o)return e;if("string"!=typeof e)return null;var t=e.match(J[Se]);return null==t?null:n((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}t=e.exports=o;var G;G="object"==typeof process&&Object({NODE_ENV:"production"})&&Object({NODE_ENV:"production"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production"}).NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var Q=256,$=Number.MAX_SAFE_INTEGER||9007199254740991,J=t.re=[],ee=t.src=[],te=0,re=te++;ee[re]="0|[1-9]\\d*";var ne=te++;ee[ne]="[0-9]+";var ie=te++;ee[ie]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var ae=te++;ee[ae]="("+ee[re]+")\\.("+ee[re]+")\\.("+ee[re]+")";var oe=te++;ee[oe]="("+ee[ne]+")\\.("+ee[ne]+")\\.("+ee[ne]+")";var se=te++;ee[se]="(?:"+ee[re]+"|"+ee[ie]+")";var fe=te++;ee[fe]="(?:"+ee[ne]+"|"+ee[ie]+")";var ce=te++;ee[ce]="(?:-("+ee[se]+"(?:\\."+ee[se]+")*))";var ue=te++;ee[ue]="(?:-?("+ee[fe]+"(?:\\."+ee[fe]+")*))";var de=te++;ee[de]="[0-9A-Za-z-]+";var le=te++;ee[le]="(?:\\+("+ee[de]+"(?:\\."+ee[de]+")*))";var he=te++,pe="v?"+ee[ae]+ee[ce]+"?"+ee[le]+"?";ee[he]="^"+pe+"$";var be="[v=\\s]*"+ee[oe]+ee[ue]+"?"+ee[le]+"?",ve=te++;ee[ve]="^"+be+"$";var me=te++;ee[me]="((?:<|>)?=?)";var ge=te++;ee[ge]=ee[ne]+"|x|X|\\*";var ye=te++;ee[ye]=ee[re]+"|x|X|\\*";var we=te++;ee[we]="[v=\\s]*("+ee[ye]+")(?:\\.("+ee[ye]+")(?:\\.("+ee[ye]+")(?:"+ee[ce]+")?"+ee[le]+"?)?)?";var _e=te++;ee[_e]="[v=\\s]*("+ee[ge]+")(?:\\.("+ee[ge]+")(?:\\.("+ee[ge]+")(?:"+ee[ue]+")?"+ee[le]+"?)?)?";var ke=te++;ee[ke]="^"+ee[me]+"\\s*"+ee[we]+"$";var xe=te++;ee[xe]="^"+ee[me]+"\\s*"+ee[_e]+"$";var Se=te++;ee[Se]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Ae=te++;ee[Ae]="(?:~>?)";var Me=te++;ee[Me]="(\\s*)"+ee[Ae]+"\\s+",J[Me]=new RegExp(ee[Me],"g");var Ee=te++;ee[Ee]="^"+ee[Ae]+ee[we]+"$";var Ce=te++;ee[Ce]="^"+ee[Ae]+ee[_e]+"$";var Ie=te++;ee[Ie]="(?:\\^)";var Te=te++;ee[Te]="(\\s*)"+ee[Ie]+"\\s+",J[Te]=new RegExp(ee[Te],"g");var Pe=te++;ee[Pe]="^"+ee[Ie]+ee[we]+"$";var Re=te++;ee[Re]="^"+ee[Ie]+ee[_e]+"$";var Be=te++;ee[Be]="^"+ee[me]+"\\s*("+be+")$|^$";var Oe=te++;ee[Oe]="^"+ee[me]+"\\s*("+pe+")$|^$";var Ne=te++;ee[Ne]="(\\s*)"+ee[me]+"\\s*("+be+"|"+ee[we]+")",J[Ne]=new RegExp(ee[Ne],"g");var Fe=te++;ee[Fe]="^\\s*("+ee[we]+")\\s+-\\s+("+ee[we]+")\\s*$";var je=te++;ee[je]="^\\s*("+ee[_e]+")\\s+-\\s+("+ee[_e]+")\\s*$";var ze=te++;ee[ze]="(<|>)?=?\\s*\\*";for(var He=0;He=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=s,t.diff=f,t.compareIdentifiers=c;var qe=/^[0-9]+$/;t.rcompareIdentifiers=u,t.major=d,t.minor=l,t.patch=h,t.compare=p,t.compareLoose=b,t.rcompare=v,t.sort=m,t.rsort=g,t.gt=y,t.lt=w,t.eq=_,t.neq=k,t.gte=x,t.lte=S,t.cmp=A,t.Comparator=M;var Le={};M.prototype.parse=function(e){var t=this.loose?J[Be]:J[Oe],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new o(r[2],this.loose):this.semver=Le},M.prototype.toString=function(){return this.value},M.prototype.test=function(e){return G("Comparator.test",e,this.loose),this.semver===Le||("string"==typeof e&&(e=new o(e,this.loose)),A(e,this.operator,this.semver,this.loose))},M.prototype.intersects=function(e,t){if(!(e instanceof M))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new E(e.value,t),q(this.value,r,t);if(""===e.operator)return r=new E(this.value,t),q(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),a=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=A(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),f=A(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||a&&o||s||f},t.Range=E,E.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},E.prototype.toString=function(){return this.range},E.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),G("range",e,t);var r=t?J[je]:J[Fe];e=e.replace(r,z),G("hyphen replace",e),e=e.replace(J[Ne],"$1$2$3"),G("comparator trim",e,J[Ne]),e=e.replace(J[Me],"$1~"),e=e.replace(J[Te],"$1^"),e=e.split(/\s+/).join(" ");var n=t?J[Be]:J[Oe],i=e.split(" ").map(function(e){return I(e,t)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(e){return!!e.match(n)})),i=i.map(function(e){return new M(e,t)})},E.prototype.intersects=function(e,t){if(!(e instanceof E))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return e.set.some(function(e){return e.every(function(e){return r.intersects(e,t)})})})})},t.toComparators=C,E.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new o(e,this.loose));for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:u.DEFAULT_WALLET,r=t.name,n=void 0===r?"myWallet":r,a=t.version,o=void 0===a?u.DEFAULT_WALLET.version:a,s=t.scrypt,f=void 0===s?{}:s,c=t.accounts,d=void 0===c?[]:c,l=t.extra,p=void 0===l?null:l;i(this,e),this.name=n,this.version=o,this.scrypt=f,this.accounts=[];var b=!0,v=!1,m=void 0;try{for(var g,y=d[Symbol.iterator]();!(b=(g=y.next()).done);b=!0){var w=g.value;this.addAccount(w)}}catch(e){v=!0,m=e}finally{try{!b&&y.return&&y.return()}finally{if(v)throw m}}this.extra=p,h.info("New Wallet created: "+this.name)}return a(e,[{key:"addAccount",value:function(e){var t=this.accounts.length;e instanceof c.default||(e=new c.default(e)),this.accounts.push(e);try{var r=e.address;h.info("Added Account: "+r+" to Wallet "+this.name)}catch(e){h.warn("Encrypted account added to Wallet "+this.name+". You will not be able to export this wallet without first decrypting this account")}return t}},{key:"decrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].decrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"decryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.decrypt(i,e))}),h.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"encrypt",value:function(e,t){if(e<0)throw new Error("Index cannot be negative!");if(e>=this.accounts.length)throw new Error("Index cannot larger than Accounts array!");try{return this.accounts[e].encrypt(t,this.scrypt),!0}catch(e){return!1}}},{key:"encryptAll",value:function(e){var t=this,r=[];return this.accounts.map(function(n,i){r.push(t.encrypt(i,e))}),h.info("decryptAll for Wallet "+this.name+": "+r.reduce(function(e,t){return t+(e?"1":"0")},"")),r}},{key:"export",value:function(){return{name:this.name,version:this.version,scrypt:this.scrypt,accounts:this.accounts.map(function(e){return e.export()}),extra:this.extra}}},{key:"setDefault",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.address=t.address||"",this.net=t.net||"NoNet",this.claims=t.claims?t.claims.map(function(e){return(0,a.ClaimItem)(e)}):[]}return i(e,[{key:s.default.inspect.custom,value:function(e,t){var r=this.claims.map(function(e){return e.txid+" <"+e.index+">: "+e.claim.toString()});return"[Claims("+this.net+"): "+this.address+"]\n"+JSON.stringify(r,null,2)}},{key:"export",value:function(){return{address:this.address,net:this.net,claims:this.claims.map(c)}}},{key:"slice",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new e({address:this.address,net:this.net,claims:this.claims.slice(t,r)})}},{key:Symbol.toStringTag,get:function(){return"Claims"}}]),e}();t.default=f;var c=function(e){return{claim:e.claim.toNumber(),txid:e.txid,index:e.index,value:e.value,start:e.start?e.start.toNumber():null,end:e.end?e.end.toNumber():null}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"NEO",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd";return h.warn("This is deprecated in favor of getPrices. There is a known bug for NEP5 tokens with this function."),o("https://api.coinmarketcap.com/v1/ticker/"+e.toLowerCase()+"/",t).then(function(t){var r=t[e.toUpperCase()];if(r)return r;throw new Error("Something went wrong with the CoinMarketCap API!")}).catch(function(e){throw h.error(e.message),e})},t.getPrices=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["NEO"];return o("https://api.coinmarketcap.com/v1/ticker/",arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd").then(function(t){e=e.map(function(e){return e.toUpperCase()});var r=f.apply(void 0,[t].concat(a(e)));if(e.some(function(e){return!r[e]}))throw new Error("None of the coin symbols are supported by CoinMarketCap!");return r}).catch(function(e){throw h.error(e.message),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTransferToken=t.getToken=t.getTokenBalance=t.getTokenInfo=void 0;var n=r(32),i=r(7),a=r(17),o=r(1),s=r(35),f=r(14),c=r(3),u=r(4),d=function(e){return e&&e.__esModule?e:{default:e}}(u),l=(0,d.default)("api"),h=function(e){return""===e?0:parseInt(e,10)},p=function(e){return e?parseInt((0,o.reverseHex)(e),16):0},b=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,h,p),v=(0,a.VMZip)(o.hexstring2str,o.hexstring2str,h,p,p);t.getTokenInfo=function(e,t){var r=new n.ScriptBuilder;r.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply");var i=r.str;return a.Query.invokeScript(i,!1).parseWith(b).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2])}}).catch(function(e){throw l.error("getTokenInfo failed with : "+e.message),e})},t.getTokenBalance=function(e,t,r){var s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r)),f=new n.ScriptBuilder,c=f.emitAppCall(t,"decimals").emitAppCall(t,"balanceOf",[s]).str;return a.Query.invokeScript(c,!1).execute(e).then(function(e){try{var t=h(e.result.stack[0].value);return p(e.result.stack[1].value)/Math.pow(10,t)}catch(e){return 0}}).catch(function(e){throw l.error("getTokenBalance failed with : "+e.message),e})},t.getToken=function(e,t,r){var s=r?v:b,f=new n.ScriptBuilder;if(f.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply"),r){var c=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(r));f.emitAppCall(t,"balanceOf",[c])}var u=f.str;return a.Query.invokeScript(u,!1).parseWith(s).execute(e).then(function(e){return{name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3]/Math.pow(10,e[2]),balance:5===e.length?e[4]/Math.pow(10,e[2]):null}}).catch(function(e){throw l.error("getToken failed with : "+e.message),e})},t.doTransferToken=function(e,t,r,n,u){var d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;l.warn("doTransferToken will be deprecated in favor of doInvoke");var p=new i.Account(r),b=(0,s.getRPCEndpoint)(e),v=(0,s.getBalance)(e,p.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var r=e[1],a=(0,i.getScriptHashFromAddress)(p.address),s=(0,o.reverseHex)((0,i.getScriptHashFromAddress)(n)),l=[{assetId:c.ASSET_ID.GAS,value:1e-8,scriptHash:a}],b={scriptHash:t,operation:"transfer",args:[(0,o.reverseHex)(a),s,u]},v=f.Transaction.createInvocationTx(r,l,b,d,{version:1});return h?h(v,p.publicKey):v.sign(p.privateKey)}).then(function(e){return m=e,a.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})}}])}); \ No newline at end of file diff --git a/lib/index.js.gz b/lib/index.js.gz index f9a58bf71..e77796ed2 100644 Binary files a/lib/index.js.gz and b/lib/index.js.gz differ diff --git a/package-lock.json b/package-lock.json index 150c41b38..f0e3a0b5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "dev": true }, "acorn": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", - "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", "dev": true }, "acorn-dynamic-import": { @@ -51,13 +51,15 @@ } }, "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, "ajv-keywords": { @@ -75,6 +77,17 @@ "kind-of": "3.2.2", "longest": "1.0.1", "repeat-string": "1.6.1" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } } }, "ansi-escapes": { @@ -96,12 +109,12 @@ "dev": true }, "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "2.3.11", + "micromatch": "3.1.9", "normalize-path": "2.1.1" } }, @@ -118,26 +131,23 @@ "dev": true, "requires": { "delegates": "1.0.0", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", @@ -145,6 +155,12 @@ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -161,9 +177,9 @@ "dev": true }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrify": { @@ -179,9 +195,9 @@ "dev": true }, "asn1.js": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", - "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { "bn.js": "4.11.8", @@ -205,9 +221,15 @@ "dev": true }, "assertion-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", - "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, "async": { @@ -216,7 +238,7 @@ "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "dev": true, "requires": { - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "async-each": { @@ -231,6 +253,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.0.3.tgz", + "integrity": "sha1-GcenYEc3dEaPILLS0DNyrX1Mv10=", + "dev": true + }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", @@ -248,14 +276,14 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz", "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", "requires": { - "follow-redirects": "1.3.0", + "follow-redirects": "1.4.1", "is-buffer": "1.1.6" } }, "axios-mock-adapter": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/axios-mock-adapter/-/axios-mock-adapter-1.11.0.tgz", - "integrity": "sha1-luS7JwLPaQDyrl+b2+9uXchmaeI=", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/axios-mock-adapter/-/axios-mock-adapter-1.14.1.tgz", + "integrity": "sha1-yODuETSVUmdTjVZteuBoviBGcVg=", "dev": true, "requires": { "deep-equal": "1.0.1" @@ -279,7 +307,7 @@ "dev": true, "requires": { "babel-code-frame": "6.26.0", - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-helpers": "6.24.1", "babel-messages": "6.23.0", "babel-register": "6.26.0", @@ -288,21 +316,32 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", - "lodash": "4.17.4", + "lodash": "4.17.5", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-generator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", - "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "6.23.0", @@ -310,7 +349,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "source-map": "0.5.7", "trim-right": "1.0.1" } @@ -347,7 +386,7 @@ "babel-helper-function-name": "6.24.1", "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-helper-explode-assignable-expression": { @@ -412,7 +451,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-helper-remap-async-to-generator": { @@ -453,9 +492,9 @@ } }, "babel-loader": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.2.tgz", - "integrity": "sha512-jRwlFbINAeyDStqK6Dd5YuY0k5YuzQUvlz2ZamuXrXmxav3pNqe9vfJ402+2G+OmlJSXxCOpB6Uz0INM7RQe2A==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", + "integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", "dev": true, "requires": { "find-cache-dir": "1.0.0", @@ -488,8 +527,8 @@ "dev": true, "requires": { "find-up": "2.1.0", - "istanbul-lib-instrument": "1.9.1", - "test-exclude": "4.1.1" + "istanbul-lib-instrument": "1.10.1", + "test-exclude": "4.2.1" } }, "babel-plugin-syntax-async-functions": { @@ -555,7 +594,7 @@ "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-plugin-transform-es2015-classes": { @@ -808,7 +847,7 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "core-js": "2.5.1", + "core-js": "2.5.3", "regenerator-runtime": "0.10.5" }, "dependencies": { @@ -853,8 +892,8 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.9.0", - "invariant": "2.2.2", + "browserslist": "2.11.3", + "invariant": "2.2.3", "semver": "5.5.0" } }, @@ -866,9 +905,9 @@ "requires": { "babel-core": "6.26.0", "babel-runtime": "6.26.0", - "core-js": "2.5.1", + "core-js": "2.5.3", "home-or-tmp": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "mkdirp": "0.5.1", "source-map-support": "0.4.18" } @@ -879,8 +918,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.1", - "regenerator-runtime": "0.11.0" + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" } }, "babel-template": { @@ -893,7 +932,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-traverse": { @@ -909,8 +948,19 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "invariant": "2.2.3", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-types": { @@ -921,7 +971,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.5", "to-fast-properties": "1.0.3" } }, @@ -937,6 +987,32 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + } + } + }, "base-x": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", @@ -946,9 +1022,9 @@ } }, "base64-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", + "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==", "dev": true }, "bcrypt-pbkdf": { @@ -1002,9 +1078,9 @@ } }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", @@ -1012,14 +1088,43 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", + "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "kind-of": "6.0.2", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "brorand": { @@ -1028,9 +1133,9 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "browserify-aes": { @@ -1104,13 +1209,13 @@ } }, "browserslist": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.9.0.tgz", - "integrity": "sha512-vJEBcDTANoDhSHL46NeOEW5hvQw7It9uCqzeFPQhpawXfnOwnpvW5C97vn1eGJ7iCkSg8wWU0nYObE7d/N95Iw==", + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", "dev": true, "requires": { - "caniuse-lite": "1.0.30000769", - "electron-to-chromium": "1.3.27" + "caniuse-lite": "1.0.30000814", + "electron-to-chromium": "1.3.37" } }, "bs58": { @@ -1136,7 +1241,7 @@ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "1.2.1", + "base64-js": "1.2.3", "ieee754": "1.1.8", "isarray": "1.0.0" } @@ -1159,6 +1264,23 @@ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -1181,9 +1303,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30000769", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000769.tgz", - "integrity": "sha1-1oxaoHcuo+rGyX1C4jnJtNMmG5M=", + "version": "1.0.30000814", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000814.tgz", + "integrity": "sha512-Kt4dBhVlnTZ+jj+C8Bd4WT6RT4EJoX5/tlktHQfpqIMgLVrG1KBQlLf010ipMvuNrpQiAJ2A54e6MMbA0BaKxg==", "dev": true }, "caseless": { @@ -1208,12 +1330,12 @@ "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { - "assertion-error": "1.0.2", + "assertion-error": "1.1.0", "check-error": "1.0.2", "deep-eql": "3.0.1", "get-func-name": "2.0.0", "pathval": "1.1.0", - "type-detect": "4.0.5" + "type-detect": "4.0.8" } }, "chai-as-promised": { @@ -1251,20 +1373,23 @@ "dev": true }, "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz", + "integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==", "dev": true, "requires": { - "anymatch": "1.3.2", + "anymatch": "2.0.0", "async-each": "1.0.1", + "braces": "2.3.1", "fsevents": "1.1.3", - "glob-parent": "2.0.0", + "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", - "is-glob": "2.0.1", + "is-glob": "4.0.0", + "normalize-path": "2.1.1", "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" + "readdirp": "2.1.0", + "upath": "1.0.4" } }, "cipher-base": { @@ -1282,10 +1407,90 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, "clean-webpack-plugin": { - "version": "0.1.17", - "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-0.1.17.tgz", - "integrity": "sha512-Bts/V725v8Ijosp4K1cqppQXgXcrohxoMsg0CV2xL4y/vua1G5pAfHEW/eJIiKF+GNNG72mdjbipxMRFEms7yg==", + "version": "0.1.19", + "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-0.1.19.tgz", + "integrity": "sha512-M1Li5yLHECcN2MahoreuODul5LkjohJGFxLPTjl3j1ttKrF5rgjZET1SJduuqxLAuT1gAPOdkhg03qcaaU1KeA==", "dev": true, "requires": { "rimraf": "2.6.2" @@ -1343,6 +1548,16 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, "color-convert": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", @@ -1359,22 +1574,19 @@ "dev": true }, "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { "delayed-stream": "1.0.0" } }, "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": "1.0.1" - } + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true }, "commondir": { "version": "1.0.1", @@ -1382,6 +1594,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1389,13 +1607,13 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "typedarray": "0.0.6" } }, @@ -1427,15 +1645,21 @@ "dev": true }, "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, "core-js": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", - "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", "dev": true }, "core-util-is": { @@ -1462,7 +1686,7 @@ "cipher-base": "1.0.4", "inherits": "2.0.3", "ripemd160": "2.0.1", - "sha.js": "2.4.9" + "sha.js": "2.4.10" } }, "create-hmac": { @@ -1476,17 +1700,17 @@ "inherits": "2.0.3", "ripemd160": "2.0.1", "safe-buffer": "5.1.1", - "sha.js": "2.4.9" + "sha.js": "2.4.10" } }, "cross-env": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.1.3.tgz", - "integrity": "sha512-UOokgwvDzCT0mqRSLEkJzUhYXB1vK3E5UgDrD41QiXsm9UetcW2rCGHYz/O3p873lMJ1VZbFCF9Izkwh7nYR5A==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.1.4.tgz", + "integrity": "sha512-Mx8mw6JWhfpYoEk7PGvHxJMLQwQHORAs8+2bX+C1lGQ4h3GkDb1zbzC2Nw85YH9ZQMlO0BHZxMacgrfPmMFxbg==", "dev": true, "requires": { "cross-spawn": "5.1.0", - "is-windows": "1.0.1" + "is-windows": "1.0.2" } }, "cross-spawn": { @@ -1495,7 +1719,7 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "shebang-command": "1.2.0", "which": "1.3.0" } @@ -1525,7 +1749,7 @@ "pbkdf2": "3.0.14", "public-encrypt": "4.0.0", "randombytes": "2.0.6", - "randomfill": "1.0.3" + "randomfill": "1.0.4" } }, "crypto-js": { @@ -1539,7 +1763,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.35" + "es5-ext": "0.10.40" } }, "dashdash": { @@ -1566,10 +1790,9 @@ "dev": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { "ms": "2.0.0" } @@ -1580,13 +1803,19 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, "requires": { - "type-detect": "4.0.5" + "type-detect": "4.0.8" } }, "deep-equal": { @@ -1616,6 +1845,16 @@ "clone": "1.0.3" } }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + } + }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", @@ -1671,15 +1910,15 @@ } }, "detect-libc": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.2.tgz", - "integrity": "sha1-ca1dIEvxempsqPRQxhRUBm70YeE=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true }, "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "diffie-hellman": { @@ -1703,9 +1942,9 @@ } }, "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, "ecc-jsbn": { @@ -1719,9 +1958,9 @@ } }, "electron-to-chromium": { - "version": "1.3.27", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", - "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=", + "version": "1.3.37", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.37.tgz", + "integrity": "sha1-SpJzTgBEyM8LFVO+V+riGkxuX6s=", "dev": true }, "elliptic": { @@ -1757,9 +1996,9 @@ } }, "errno": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.6.tgz", - "integrity": "sha512-IsORQDpaaSwcDP4ZZnHxgE85werpo34VYn1Ud3mq+eUsF593faR8oCZNXrROVkpFu2TsbrNhHin0aUrTsQ9vNw==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "dev": true, "requires": { "prr": "1.0.1" @@ -1775,9 +2014,9 @@ } }, "es5-ext": { - "version": "0.10.35", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.35.tgz", - "integrity": "sha1-GO6FjOajxFx9eekcFfzKnsVoSU8=", + "version": "0.10.40", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.40.tgz", + "integrity": "sha512-S9Fh3oya5OOvYSNGvPZJ+vyrs6VYpe1IXPowVe3N1OhaiwVaGlwfn3Zf5P5klYcWOA0toIwYQW8XEv/QqhdHvQ==", "dev": true, "requires": { "es6-iterator": "2.0.3", @@ -1791,7 +2030,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.40", "es6-symbol": "3.1.1" } }, @@ -1802,7 +2041,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.40", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", @@ -1816,7 +2055,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.40", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -1829,7 +2068,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.40" } }, "es6-weak-map": { @@ -1839,7 +2078,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.40", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } @@ -1858,40 +2097,40 @@ "requires": { "es6-map": "0.1.5", "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", + "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, "eslint": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.16.0.tgz", - "integrity": "sha512-YVXV4bDhNoHHcv0qzU4Meof7/P26B4EuaktMi5L1Tnt52Aov85KmYA8c5D+xyZr/BkhvwUqr011jDSD/QTULxg==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz", + "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==", "dev": true, "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "2.3.0", - "concat-stream": "1.6.0", + "chalk": "2.3.2", + "concat-stream": "1.6.1", "cross-spawn": "5.1.0", "debug": "3.1.0", "doctrine": "2.1.0", "eslint-scope": "3.7.1", "eslint-visitor-keys": "1.0.0", - "espree": "3.5.2", + "espree": "3.5.4", "esquery": "1.0.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "11.1.0", + "globals": "11.3.0", "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "3.3.0", - "is-resolvable": "1.0.1", - "js-yaml": "3.10.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", @@ -1907,18 +2146,6 @@ "text-table": "0.2.0" }, "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -1926,44 +2153,29 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" + "supports-color": "5.3.0" } }, "globals": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.1.0.tgz", - "integrity": "sha512-uEuWt9mqTlPDwSqi+sHjD4nWU/1N+q0fiWI9T1mZpD2UENqX20CFD5T/ziLZvztPaBKl7ZylUi1q6Qfm7E2CiQ==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", "dev": true }, "strip-ansi": { @@ -1976,12 +2188,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -1993,13 +2205,24 @@ "dev": true }, "eslint-import-resolver-node": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { "debug": "2.6.9", "resolve": "1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "eslint-module-utils": { @@ -2012,6 +2235,15 @@ "pkg-dir": "1.0.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -2043,23 +2275,32 @@ } }, "eslint-plugin-import": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", - "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz", + "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=", "dev": true, "requires": { "builtin-modules": "1.1.1", "contains-path": "0.1.0", "debug": "2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "0.3.1", + "eslint-import-resolver-node": "0.3.2", "eslint-module-utils": "2.1.1", "has": "1.0.1", - "lodash.cond": "4.5.2", + "lodash": "4.17.5", "minimatch": "3.0.4", "read-pkg-up": "2.0.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", @@ -2069,33 +2310,87 @@ "esutils": "2.0.2", "isarray": "1.0.0" } - } - } - }, - "eslint-plugin-node": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", - "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", - "dev": true, - "requires": { - "ignore": "3.3.7", - "minimatch": "3.0.4", - "resolve": "1.5.0", - "semver": "5.3.0" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "eslint-plugin-node": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", + "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", + "dev": true, + "requires": { + "ignore": "3.3.7", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true } } }, "eslint-plugin-promise": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", - "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz", + "integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==", "dev": true }, "eslint-plugin-standard": { @@ -2110,7 +2405,7 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.0", + "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, @@ -2121,12 +2416,12 @@ "dev": true }, "espree": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", - "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.2.1", + "acorn": "5.5.3", "acorn-jsx": "3.0.1" } }, @@ -2146,13 +2441,12 @@ } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "4.2.0" } }, "estraverse": { @@ -2174,7 +2468,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.40" } }, "events": { @@ -2209,21 +2503,104 @@ } }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "fill-range": "2.2.3" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, "extend": { @@ -2232,6 +2609,27 @@ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "external-editor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", @@ -2244,12 +2642,39 @@ } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "extsprintf": { @@ -2259,9 +2684,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, "fast-json-stable-stringify": { @@ -2295,23 +2720,27 @@ "object-assign": "4.1.1" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "find-cache-dir": { @@ -2321,7 +2750,7 @@ "dev": true, "requires": { "commondir": "1.0.1", - "make-dir": "1.1.0", + "make-dir": "1.2.0", "pkg-dir": "2.0.0" } }, @@ -2347,21 +2776,11 @@ } }, "follow-redirects": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.3.0.tgz", - "integrity": "sha1-9oSHH8EW0uMp/aVe9naH9Pq8kFw=", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", + "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", "requires": { "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } } }, "for-in": { @@ -2370,15 +2789,6 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2392,8 +2802,17 @@ "dev": true, "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "0.2.2" } }, "fs.realpath": { @@ -2409,7 +2828,7 @@ "dev": true, "optional": true, "requires": { - "nan": "2.8.0", + "nan": "2.9.2", "node-pre-gyp": "0.6.39" }, "dependencies": { @@ -3355,6 +3774,28 @@ "string-width": "1.0.2", "strip-ansi": "3.0.1", "wide-align": "1.1.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "generic-pool": { @@ -3380,6 +3821,12 @@ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -3411,23 +3858,25 @@ "path-is-absolute": "1.0.1" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } } }, "globals": { @@ -3464,12 +3913,6 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, "growl": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", @@ -3490,6 +3933,18 @@ "requires": { "ajv": "4.11.8", "har-schema": "1.0.5" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + } } }, "has": { @@ -3511,9 +3966,9 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "has-unicode": { @@ -3522,16 +3977,48 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, - "hash-base": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", - "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, "requires": { - "inherits": "2.0.3" + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" } }, - "hash.js": { - "version": "1.1.3", + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { @@ -3584,9 +4071,9 @@ } }, "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", "dev": true }, "http-signature": { @@ -3597,7 +4084,7 @@ "requires": { "assert-plus": "0.2.0", "jsprim": "1.4.1", - "sshpk": "1.13.1" + "sshpk": "1.14.1" } }, "https-browserify": { @@ -3652,9 +4139,9 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "inquirer": { @@ -3664,12 +4151,12 @@ "dev": true, "requires": { "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "chalk": "2.3.2", "cli-cursor": "2.1.0", "cli-width": "2.2.0", "external-editor": "2.1.0", "figures": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "mute-stream": "0.0.7", "run-async": "2.3.0", "rx-lite": "4.0.8", @@ -3686,45 +4173,23 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "supports-color": "5.3.0" } }, "strip-ansi": { @@ -3737,26 +4202,26 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "interpret": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", - "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, "invariant": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", + "integrity": "sha512-7Z5PPegwDTyjbaeCnV0efcyS6vdKAU51kpEmS7QFib3P4822l8ICYyMn7qvJnc+WzLoDsuI9gPMKbJ8pCu8XtA==", "dev": true, "requires": { "loose-envify": "1.3.1" @@ -3768,6 +4233,15 @@ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3797,19 +4271,24 @@ "builtin-modules": "1.1.1" } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } }, "is-extendable": { @@ -3819,9 +4298,9 @@ "dev": true }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-finite": { @@ -3834,30 +4313,55 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "2.1.1" } }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } } }, "is-path-cwd": { @@ -3884,17 +4388,14 @@ "path-is-inside": "1.0.2" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } }, "is-promise": { "version": "2.1.0", @@ -3903,9 +4404,9 @@ "dev": true }, "is-resolvable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", - "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-stream": { @@ -3927,9 +4428,9 @@ "dev": true }, "is-windows": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.1.tgz", - "integrity": "sha1-MQ23D3QtJZoWo2kgK1GvhCMzENk=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { @@ -3945,13 +4446,10 @@ "dev": true }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -3960,23 +4458,23 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", - "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", "dev": true }, "istanbul-lib-instrument": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz", - "integrity": "sha512-RQmXeQ7sphar7k7O1wTNzVczF9igKpaeGQAG9qR2L+BS4DCJNTI9nytRmIVYevwO0bbq+2CXvJmYDuz0gMrywA==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", "dev": true, "requires": { - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-coverage": "1.2.0", "semver": "5.5.0" } }, @@ -3995,12 +4493,12 @@ "dev": true }, "js-yaml": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "4.0.0" } }, @@ -4089,13 +4587,10 @@ } }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true }, "lazy-cache": { "version": "1.0.4", @@ -4123,15 +4618,16 @@ } }, "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", "pify": "2.3.0", - "strip-bom": "3.0.0" + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" }, "dependencies": { "pify": { @@ -4170,15 +4666,9 @@ } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true - }, - "lodash.cond": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", "dev": true }, "loglevel": { @@ -4207,9 +4697,9 @@ } }, "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -4217,14 +4707,29 @@ } }, "make-dir": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", - "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "dev": true, "requires": { "pify": "3.0.0" } }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, "md5.js": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", @@ -4253,7 +4758,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "memory-fs": { @@ -4262,29 +4767,29 @@ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "dev": true, "requires": { - "errno": "0.1.6", - "readable-stream": "2.3.3" + "errno": "0.1.7", + "readable-stream": "2.3.5" } }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", + "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.1", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" } }, "miller-rabin": { @@ -4298,24 +4803,24 @@ } }, "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "dev": true }, "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { - "mime-db": "1.30.0" + "mime-db": "1.33.0" } }, "mimic-fn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", - "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimalistic-assert": { @@ -4334,7 +4839,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -4343,6 +4848,27 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -4353,15 +4879,15 @@ } }, "mocha": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.0.tgz", - "integrity": "sha512-ukB2dF+u4aeJjc6IGtPNnJXfeby5d4ZqySlIBT0OEyva/DrMjVm5HkQxKnHDLKEfEQBsEnwTg9HHhtPHJdTd8w==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz", + "integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==", "dev": true, "requires": { - "browser-stdout": "1.3.0", + "browser-stdout": "1.3.1", "commander": "2.11.0", "debug": "3.1.0", - "diff": "3.3.1", + "diff": "3.5.0", "escape-string-regexp": "1.0.5", "glob": "7.1.2", "growl": "1.10.3", @@ -4370,21 +4896,12 @@ "supports-color": "4.4.0" }, "dependencies": { - "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", "dev": true }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -4408,17 +4925,43 @@ "dev": true }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", + "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==", "dev": true }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "neo-async": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.0.tgz", + "integrity": "sha512-nJmSswG4As/MkRq7QZFuH/sf/yuv8ODdMZrY4Bedjp77a5MK4A6s7YbBB64c9u79EBUOfXUXBvArmvzTD0X+6g==", + "dev": true + }, "node-libs-browser": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", @@ -4431,7 +4974,7 @@ "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.12.0", - "domain-browser": "1.1.7", + "domain-browser": "1.2.0", "events": "1.1.1", "https-browserify": "1.0.0", "os-browserify": "0.3.0", @@ -4439,11 +4982,11 @@ "process": "0.11.10", "punycode": "1.4.1", "querystring-es3": "0.2.1", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "stream-browserify": "2.0.1", "stream-http": "2.8.0", "string_decoder": "1.0.3", - "timers-browserify": "2.0.4", + "timers-browserify": "2.0.6", "tty-browserify": "0.0.0", "url": "0.11.0", "util": "0.10.3", @@ -4456,12 +4999,12 @@ "integrity": "sha512-OsJV74qxnvz/AMGgcfZoDaeDXKD3oY3QVIbBmwszTFkRisTSXbMQyn4UWzUMOtA5SVhrBZOTp0wcoSBgfMfMmQ==", "dev": true, "requires": { - "detect-libc": "1.0.2", + "detect-libc": "1.0.3", "hawk": "3.1.3", "mkdirp": "0.5.1", "nopt": "4.0.1", "npmlog": "4.1.2", - "rc": "1.2.2", + "rc": "1.2.6", "request": "2.81.0", "rimraf": "2.6.2", "semver": "5.5.0", @@ -4475,9 +5018,9 @@ "integrity": "sha1-p6RzrpKq6oXUxo1Fu/LJRMRhFrg=", "dev": true, "requires": { - "commander": "2.9.0", + "commander": "2.11.0", "defaults": "1.0.3", - "nan": "2.8.0", + "nan": "2.9.2", "node-pre-gyp": "0.6.39" } }, @@ -4488,7 +5031,7 @@ "dev": true, "requires": { "abbrev": "1.1.1", - "osenv": "0.1.4" + "osenv": "0.1.5" } }, "normalize-package-data": { @@ -4497,10 +5040,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.5.0", + "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", "semver": "5.5.0", - "validate-npm-package-license": "3.0.1" + "validate-npm-package-license": "3.0.3" } }, "normalize-path": { @@ -4540,9 +5083,9 @@ "dev": true }, "nyc": { - "version": "11.4.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.4.1.tgz", - "integrity": "sha512-5eCZpvaksFVjP2rt1r60cfXmt3MUtsQDw8bAzNqNEr4WLvUMLgiVENMf/B9bE9YAX0mGVvaGA3v9IS9ekNqB1Q==", + "version": "11.6.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.6.0.tgz", + "integrity": "sha512-ZaXCh0wmbk2aSBH2B5hZGGvK2s9aM8DIm2rVY+BG3Fx8tUS+bpJSswUVZqOD1YfCmnYRFSqgYJSr7UeeUcW0jg==", "dev": true, "requires": { "archy": "1.0.0", @@ -4555,23 +5098,23 @@ "find-up": "2.1.0", "foreground-child": "1.5.6", "glob": "7.1.2", - "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-coverage": "1.2.0", "istanbul-lib-hook": "1.1.0", - "istanbul-lib-instrument": "1.9.1", - "istanbul-lib-report": "1.1.2", - "istanbul-lib-source-maps": "1.2.2", - "istanbul-reports": "1.1.3", + "istanbul-lib-instrument": "1.10.1", + "istanbul-lib-report": "1.1.3", + "istanbul-lib-source-maps": "1.2.3", + "istanbul-reports": "1.3.0", "md5-hex": "1.3.0", - "merge-source-map": "1.0.4", + "merge-source-map": "1.1.0", "micromatch": "2.3.11", "mkdirp": "0.5.1", "resolve-from": "2.0.0", "rimraf": "2.6.2", "signal-exit": "3.0.2", "spawn-wrap": "1.4.2", - "test-exclude": "4.1.1", - "yargs": "10.0.3", - "yargs-parser": "8.0.0" + "test-exclude": "4.2.1", + "yargs": "11.1.0", + "yargs-parser": "8.1.0" }, "dependencies": { "align-text": { @@ -4625,6 +5168,11 @@ "bundled": true, "dev": true }, + "arr-union": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, "array-unique": { "version": "0.2.1", "bundled": true, @@ -4635,11 +5183,21 @@ "bundled": true, "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "async": { "version": "1.5.2", "bundled": true, "dev": true }, + "atob": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, "babel-code-frame": { "version": "6.26.0", "bundled": true, @@ -4651,7 +5209,7 @@ } }, "babel-generator": { - "version": "6.26.0", + "version": "6.26.1", "bundled": true, "dev": true, "requires": { @@ -4660,7 +5218,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "source-map": "0.5.7", "trim-right": "1.0.1" } @@ -4691,7 +5249,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-traverse": { @@ -4706,8 +5264,8 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "invariant": "2.2.3", + "lodash": "4.17.5" } }, "babel-types": { @@ -4717,7 +5275,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.5", "to-fast-properties": "1.0.3" } }, @@ -4731,8 +5289,37 @@ "bundled": true, "dev": true }, + "base": { + "version": "0.11.2", + "bundled": true, + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "brace-expansion": { - "version": "1.1.8", + "version": "1.1.11", "bundled": true, "dev": true, "requires": { @@ -4755,6 +5342,29 @@ "bundled": true, "dev": true }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "caching-transform": { "version": "1.0.1", "bundled": true, @@ -4793,45 +5403,141 @@ "supports-color": "2.0.0" } }, - "cliui": { - "version": "2.1.0", + "class-utils": { + "version": "0.3.6", "bundled": true, "dev": true, - "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" }, "dependencies": { - "wordwrap": { - "version": "0.0.2", + "define-property": { + "version": "0.2.5", "bundled": true, "dev": true, - "optional": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true }, "convert-source-map": { "version": "1.5.1", "bundled": true, "dev": true }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, "core-js": { "version": "2.5.3", "bundled": true, @@ -4842,7 +5548,7 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "which": "1.3.0" } }, @@ -4864,6 +5570,11 @@ "bundled": true, "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, "default-require-extensions": { "version": "1.0.0", "bundled": true, @@ -4872,6 +5583,22 @@ "strip-bom": "2.0.0" } }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "detect-indent": { "version": "4.0.0", "bundled": true, @@ -4917,7 +5644,7 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "shebang-command": "1.2.0", "which": "1.3.0" } @@ -4940,6 +5667,25 @@ "fill-range": "2.2.3" } }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "extglob": { "version": "0.3.2", "bundled": true, @@ -5005,6 +5751,14 @@ "signal-exit": "3.0.2" } }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "dev": true, + "requires": { + "map-cache": "0.2.2" + } + }, "fs.realpath": { "version": "1.0.0", "bundled": true, @@ -5020,6 +5774,11 @@ "bundled": true, "dev": true }, + "get-value": { + "version": "2.0.6", + "bundled": true, + "dev": true + }, "glob": { "version": "7.1.2", "bundled": true, @@ -5094,8 +5853,62 @@ "bundled": true, "dev": true }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "hosted-git-info": { - "version": "2.5.0", + "version": "2.6.0", "bundled": true, "dev": true }, @@ -5119,7 +5932,7 @@ "dev": true }, "invariant": { - "version": "2.2.2", + "version": "2.2.3", "bundled": true, "dev": true, "requires": { @@ -5131,6 +5944,21 @@ "bundled": true, "dev": true }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "is-arrayish": { "version": "0.2.1", "bundled": true, @@ -5149,6 +5977,38 @@ "builtin-modules": "1.1.1" } }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "is-dotfile": { "version": "1.0.3", "bundled": true, @@ -5181,12 +6041,9 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } + "dev": true }, "is-glob": { "version": "2.0.1", @@ -5204,6 +6061,36 @@ "kind-of": "3.2.2" } }, + "is-odd": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "bundled": true, + "dev": true + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "is-posix-bracket": { "version": "0.1.1", "bundled": true, @@ -5224,6 +6111,11 @@ "bundled": true, "dev": true }, + "is-windows": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, "isarray": { "version": "1.0.0", "bundled": true, @@ -5243,7 +6135,7 @@ } }, "istanbul-lib-coverage": { - "version": "1.1.1", + "version": "1.2.0", "bundled": true, "dev": true }, @@ -5256,25 +6148,25 @@ } }, "istanbul-lib-instrument": { - "version": "1.9.1", + "version": "1.10.1", "bundled": true, "dev": true, "requires": { - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.1", - "semver": "5.4.1" + "istanbul-lib-coverage": "1.2.0", + "semver": "5.5.0" } }, "istanbul-lib-report": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-coverage": "1.2.0", "mkdirp": "0.5.1", "path-parse": "1.0.5", "supports-color": "3.2.3" @@ -5291,12 +6183,12 @@ } }, "istanbul-lib-source-maps": { - "version": "1.2.2", + "version": "1.2.3", "bundled": true, "dev": true, "requires": { "debug": "3.1.0", - "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-coverage": "1.2.0", "mkdirp": "0.5.1", "rimraf": "2.6.2", "source-map": "0.5.7" @@ -5313,7 +6205,7 @@ } }, "istanbul-reports": { - "version": "1.1.3", + "version": "1.3.0", "bundled": true, "dev": true, "requires": { @@ -5381,7 +6273,7 @@ } }, "lodash": { - "version": "4.17.4", + "version": "4.17.5", "bundled": true, "dev": true }, @@ -5399,7 +6291,7 @@ } }, "lru-cache": { - "version": "4.1.1", + "version": "4.1.2", "bundled": true, "dev": true, "requires": { @@ -5407,6 +6299,19 @@ "yallist": "2.1.2" } }, + "map-cache": { + "version": "0.2.2", + "bundled": true, + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, "md5-hex": { "version": "1.3.0", "bundled": true, @@ -5425,15 +6330,22 @@ "bundled": true, "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "merge-source-map": { - "version": "1.0.4", + "version": "1.1.0", "bundled": true, "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } } }, "micromatch": { @@ -5457,7 +6369,7 @@ } }, "mimic-fn": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, "dev": true }, @@ -5466,7 +6378,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -5474,6 +6386,25 @@ "bundled": true, "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "bundled": true, @@ -5487,15 +6418,51 @@ "bundled": true, "dev": true }, + "nanomatch": { + "version": "1.2.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "normalize-package-data": { "version": "2.4.0", "bundled": true, "dev": true, "requires": { - "hosted-git-info": "2.5.0", + "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" } }, "normalize-path": { @@ -5524,6 +6491,74 @@ "bundled": true, "dev": true }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "object.omit": { "version": "2.0.1", "bundled": true, @@ -5533,6 +6568,21 @@ "is-extendable": "0.1.1" } }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, "once": { "version": "1.4.0", "bundled": true, @@ -5571,18 +6621,26 @@ "dev": true }, "p-limit": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, - "dev": true + "dev": true, + "requires": { + "p-try": "1.0.0" + } }, "p-locate": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "1.2.0" } }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "parse-glob": { "version": "3.0.4", "bundled": true, @@ -5602,6 +6660,11 @@ "error-ex": "1.3.1" } }, + "pascalcase": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, "path-exists": { "version": "2.1.0", "bundled": true, @@ -5672,6 +6735,11 @@ } } }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, "preserve": { "version": "0.2.0", "bundled": true, @@ -5762,6 +6830,15 @@ "is-equal-shallow": "0.1.3" } }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, "remove-trailing-separator": { "version": "1.1.0", "bundled": true, @@ -5800,6 +6877,16 @@ "bundled": true, "dev": true }, + "resolve-url": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "ret": { + "version": "0.1.15", + "bundled": true, + "dev": true + }, "right-align": { "version": "0.1.3", "bundled": true, @@ -5817,8 +6904,16 @@ "glob": "7.1.2" } }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, "semver": { - "version": "5.4.1", + "version": "5.5.0", "bundled": true, "dev": true }, @@ -5827,6 +6922,27 @@ "bundled": true, "dev": true }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, "shebang-command": { "version": "1.2.0", "bundled": true, @@ -5850,72 +6966,289 @@ "bundled": true, "dev": true }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "1.5.6", - "mkdirp": "0.5.1", - "os-homedir": "1.0.2", - "rimraf": "2.6.2", - "signal-exit": "3.0.2", - "which": "1.3.0" - } - }, - "spdx-correct": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "spdx-license-ids": "1.2.2" - } - }, - "spdx-expression-parse": { - "version": "1.0.4", - "bundled": true, - "dev": true - }, - "spdx-license-ids": { - "version": "1.2.2", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.1.1", + "snapdragon": { + "version": "0.8.2", "bundled": true, "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.1", + "use": "3.1.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", + "define-property": { + "version": "0.2.5", "bundled": true, - "dev": true + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } }, - "is-fullwidth-code-point": { - "version": "2.0.0", + "extend-shallow": { + "version": "2.0.1", "bundled": true, - "dev": true + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } }, - "strip-ansi": { - "version": "4.0.0", + "is-accessor-descriptor": { + "version": "0.1.6", "bundled": true, "dev": true, "requires": { - "ansi-regex": "3.0.0" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true } } }, - "strip-ansi": { + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, + "source-map-resolve": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "atob": "2.0.3", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.6.2", + "signal-exit": "3.0.2", + "which": "1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { "version": "3.0.1", "bundled": true, "dev": true, @@ -5942,15 +7275,249 @@ "dev": true }, "test-exclude": { - "version": "4.1.1", + "version": "4.2.1", "bundled": true, "dev": true, "requires": { "arrify": "1.0.1", - "micromatch": "2.3.11", + "micromatch": "3.1.9", "object-assign": "4.1.1", "read-pkg-up": "1.0.1", "require-main-filename": "1.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "braces": { + "version": "2.3.1", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "kind-of": "6.0.2", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + }, + "micromatch": { + "version": "3.1.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.1", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + } } }, "to-fast-properties": { @@ -5958,6 +7525,44 @@ "bundled": true, "dev": true }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + } + } + }, "trim-right": { "version": "1.0.1", "bundled": true, @@ -5994,13 +7599,106 @@ "dev": true, "optional": true }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true, + "dev": true + }, + "use": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "validate-npm-package-license": { - "version": "3.0.1", + "version": "3.0.3", "bundled": true, "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" } }, "which": { @@ -6036,6 +7734,14 @@ "strip-ansi": "3.0.1" }, "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, "string-width": { "version": "1.0.2", "bundled": true, @@ -6074,11 +7780,11 @@ "dev": true }, "yargs": { - "version": "10.0.3", + "version": "11.1.0", "bundled": true, "dev": true, "requires": { - "cliui": "3.2.0", + "cliui": "4.0.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", @@ -6089,70 +7795,160 @@ "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", - "yargs-parser": "8.0.0" + "yargs-parser": "9.0.2" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + }, "cliui": { - "version": "3.2.0", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "wrap-ansi": "2.1.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - } } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "8.1.0", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true } } + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } }, - "yargs-parser": { - "version": "8.0.0", - "bundled": true, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "camelcase": "4.1.0" + "kind-of": "3.2.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" }, "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } } } }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "isobject": "3.0.1" } }, "once": { @@ -6170,7 +7966,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "optionator": { @@ -6217,9 +8013,9 @@ "dev": true }, "osenv": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "requires": { "os-homedir": "1.0.2", @@ -6233,10 +8029,13 @@ "dev": true }, "p-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", - "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } }, "p-locate": { "version": "2.0.0", @@ -6244,9 +8043,15 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "1.2.0" } }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "pako": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", @@ -6259,25 +8064,13 @@ "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "dev": true, "requires": { - "asn1.js": "4.9.2", + "asn1.js": "4.10.1", "browserify-aes": "1.1.1", "create-hash": "1.1.3", "evp_bytestokey": "1.0.3", "pbkdf2": "3.0.14" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -6287,12 +8080,24 @@ "error-ex": "1.3.1" } }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -6324,12 +8129,14 @@ "dev": true }, "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "pify": "2.3.0" + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" }, "dependencies": { "pify": { @@ -6356,7 +8163,7 @@ "create-hmac": "1.1.6", "ripemd160": "2.0.1", "safe-buffer": "5.1.1", - "sha.js": "2.4.9" + "sha.js": "2.4.10" } }, "performance-now": { @@ -6401,18 +8208,18 @@ "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -6426,9 +8233,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { @@ -6486,47 +8293,6 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, "randombytes": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", @@ -6537,9 +8303,9 @@ } }, "randomfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", - "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { "randombytes": "2.0.6", @@ -6547,13 +8313,13 @@ } }, "rc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", - "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.6.tgz", + "integrity": "sha1-6xiYnG1PTxYsOZ953dKfODVWgJI=", "dev": true, "requires": { "deep-extend": "0.4.2", - "ini": "1.3.4", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, @@ -6567,36 +8333,57 @@ } }, "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "2.0.0", + "load-json-file": "1.1.0", "normalize-package-data": "2.4.0", - "path-type": "2.0.0" + "path-type": "1.1.0" } }, "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "find-up": "1.1.2", + "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + } } }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", + "process-nextick-args": "2.0.0", "safe-buffer": "5.1.1", "string_decoder": "1.0.3", "util-deprecate": "1.0.2" @@ -6610,7 +8397,7 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "set-immediate-shim": "1.0.1" } }, @@ -6621,9 +8408,9 @@ "dev": true }, "regenerator-runtime": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regenerator-transform": { @@ -6637,13 +8424,14 @@ "private": "0.1.8" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" } }, "regexpu-core": { @@ -6716,7 +8504,7 @@ "aws-sign2": "0.6.0", "aws4": "1.6.0", "caseless": "0.12.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "extend": "3.0.1", "forever-agent": "0.6.1", "form-data": "2.1.4", @@ -6726,15 +8514,15 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", + "mime-types": "2.1.18", "oauth-sign": "0.8.2", "performance-now": "0.2.0", "qs": "6.4.0", "safe-buffer": "5.1.1", "stringstream": "0.0.5", - "tough-cookie": "2.3.3", + "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "uuid": "3.2.1" } }, "require-directory": { @@ -6774,6 +8562,12 @@ "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -6784,6 +8578,12 @@ "signal-exit": "3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -6840,6 +8640,15 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, "scrypt-js": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", @@ -6867,6 +8676,29 @@ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -6874,9 +8706,9 @@ "dev": true }, "sha.js": { - "version": "2.4.9", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", - "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.10.tgz", + "integrity": "sha512-vnwmrFDlOExK4Nm16J2KMWHLrp14lBrjxMxBJpu++EnsuBmpiYaM/MEs46Vxxm/4FvdP5yTwuCTO9it5FSjrqA==", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -6916,16 +8748,152 @@ "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.1", + "use": "3.1.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "sntp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", @@ -6947,6 +8915,19 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-resolve": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "dev": true, + "requires": { + "atob": "2.0.3", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -6956,27 +8937,53 @@ "source-map": "0.5.7" } }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-license-ids": "1.2.2" + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -6984,9 +8991,9 @@ "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "dev": true, "requires": { "asn1": "0.2.3", @@ -7007,6 +9014,84 @@ } } }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, "stream-browserify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", @@ -7014,7 +9099,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "stream-http": { @@ -7025,20 +9110,36 @@ "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "to-arraybuffer": "1.0.1", "xtend": "4.0.1" } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } } }, "string_decoder": { @@ -7066,10 +9167,13 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } }, "strip-eof": { "version": "1.0.0", @@ -7097,219 +9201,100 @@ "requires": { "ajv": "5.5.2", "ajv-keywords": "2.1.1", - "chalk": "2.3.0", - "lodash": "4.17.4", + "chalk": "2.3.2", + "lodash": "4.17.5", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, - "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", - "dev": true, - "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } - } - }, - "tapable": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", - "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", - "dev": true - }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.1.tgz", - "integrity": "sha512-PPRybI9+jM5tjtCbN2cxmmRU7YmqT3Zv/UDy48tAh2XRkLa9bAORtSWLkVc13+GJF+cdTh1yEnHEk3cpTaL5Kg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.3.3", - "rimraf": "2.6.2", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "test-exclude": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.1.1.tgz", - "integrity": "sha512-35+Asrsk3XHJDBgf/VRFexPgh3UyETv8IAn/LRTiZjVy6rjPVqdEk8dJcJYBzl1w0XCJM48lvTy8SfEsCWS4nA==", - "dev": true, - "requires": { - "arrify": "1.0.1", - "micromatch": "2.3.11", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "require-main-filename": "1.0.1" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" } }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "has-flag": "3.0.0" } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + } + } + }, + "tapable": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", + "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "dev": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.1.tgz", + "integrity": "sha512-PPRybI9+jM5tjtCbN2cxmmRU7YmqT3Zv/UDy48tAh2XRkLa9bAORtSWLkVc13+GJF+cdTh1yEnHEk3cpTaL5Kg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.3.5", + "rimraf": "2.6.2", + "tar": "2.2.1", + "uid-number": "0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "is-utf8": "0.2.1" + "ms": "2.0.0" } } } }, + "test-exclude": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "3.1.9", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7323,9 +9308,9 @@ "dev": true }, "timers-browserify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.6.tgz", + "integrity": "sha512-HQ3nbYRAowdVd0ckGFvmJPPCOH/CHleFN/Y0YQCX1DVaB7t+KFvisuyN09fuP8Jtp1CpfSh8O8bMkHbdbPe6Pw==", "dev": true, "requires": { "setimmediate": "1.0.5" @@ -7352,10 +9337,52 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { "punycode": "1.4.1" @@ -7399,9 +9426,9 @@ } }, "type-detect": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz", - "integrity": "sha512-N9IvkQslUGYGC24RkJk1ba99foK6TkwC2FHAEBlQFBP0RxQZS8ZpJuAZcwiY/w9ZJHFQb1aOXBI60OdxhTrwEQ==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, "typedarray": { @@ -7450,7 +9477,7 @@ "requires": { "source-map": "0.5.7", "uglify-js": "2.8.29", - "webpack-sources": "1.0.2" + "webpack-sources": "1.1.0" } }, "uid-number": { @@ -7459,6 +9486,93 @@ "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", "dev": true }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.4.tgz", + "integrity": "sha512-d4SJySNBXDaQp+DPrziv3xGS6w3d2Xt69FijJr86zMPBy23JEloMCEOUBBzuN7xCtjLCnmB9tI/z7SBCahHBOw==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -7477,6 +9591,15 @@ } } }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, "util": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", @@ -7501,19 +9624,19 @@ "dev": true }, "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true }, "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" } }, "verror": { @@ -7545,30 +9668,30 @@ } }, "watchpack": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", - "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.5.0.tgz", + "integrity": "sha512-RSlipNQB1u48cq0wH/BNfCu1tD/cJ8ydFIkNYhp9o+3d+8unClkIovpW5qpFPgmL9OE48wfAnlZydXByWP82AA==", "dev": true, "requires": { - "async": "2.6.0", - "chokidar": "1.7.0", - "graceful-fs": "4.1.11" + "chokidar": "2.0.2", + "graceful-fs": "4.1.11", + "neo-async": "2.5.0" } }, "webpack": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz", - "integrity": "sha512-fxxKXoicjdXNUMY7LIdY89tkJJJ0m1Oo8PQutZ5rLgWbV5QVKI15Cn7+/IHnRTd3vfKfiwBx6SBqlorAuNA8LA==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.11.0.tgz", + "integrity": "sha512-3kOFejWqj5ISpJk4Qj/V7w98h9Vl52wak3CLiw/cDOfbVTq7FeoZ0SdoHHY9PYlHr50ZS42OfvzE2vB4nncKQg==", "dev": true, "requires": { - "acorn": "5.2.1", + "acorn": "5.5.3", "acorn-dynamic-import": "2.0.2", - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", + "ajv": "6.2.1", + "ajv-keywords": "3.1.0", "async": "2.6.0", "enhanced-resolve": "3.4.1", "escope": "3.6.0", - "interpret": "1.0.4", + "interpret": "1.1.0", "json-loader": "0.5.7", "json5": "0.5.1", "loader-runner": "2.3.0", @@ -7580,27 +9703,26 @@ "supports-color": "4.5.0", "tapable": "0.2.8", "uglifyjs-webpack-plugin": "0.4.6", - "watchpack": "1.4.0", - "webpack-sources": "1.0.2", + "watchpack": "1.5.0", + "webpack-sources": "1.1.0", "yargs": "8.0.2" }, "dependencies": { "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.2.1.tgz", + "integrity": "sha1-KKarxJOiq+D7TIUHrK7bQ/pVBnE=", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", + "fast-deep-equal": "1.1.0", "fast-json-stable-stringify": "2.0.0", "json-schema-traverse": "0.3.1" } }, "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz", + "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=", "dev": true }, "has-flag": { @@ -7621,9 +9743,9 @@ } }, "webpack-sources": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.2.tgz", - "integrity": "sha512-Y7UddMCv6dGjy81nBv6nuQeFFIt5aalHm7uyDsAsW86nZwfOVPGRr3XMjEQLaT+WKo8rlzhC9qtbJvYKLtAwaw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", "dev": true, "requires": { "source-list-map": "2.0.0", @@ -7660,6 +9782,28 @@ "dev": true, "requires": { "string-width": "1.0.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "wif": { @@ -7690,6 +9834,28 @@ "requires": { "string-width": "1.0.2", "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "wrappy": { @@ -7746,12 +9912,6 @@ "yargs-parser": "7.0.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -7782,32 +9942,68 @@ } } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - } + "number-is-nan": "1.0.1" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true } } }, @@ -7836,7 +10032,7 @@ "requires": { "async": "2.6.0", "node-zopfli": "2.0.2", - "webpack-sources": "1.0.2" + "webpack-sources": "1.1.0" } } } diff --git a/src/api/core.js b/src/api/core.js index 1853c3ee0..c7107fe30 100644 --- a/src/api/core.js +++ b/src/api/core.js @@ -292,11 +292,20 @@ const attachInvokedContractForMintToken = config => { return Query.getContractState(config.script.scriptHash) .execute(config.url) .then(contractState => { + const { parameters } = contractState.result const attachInvokedContract = { - invocationScript: '0000', - verificationScript: contractState.result.script + invocationScript: ('00').repeat(parameters.length), + verificationScript: '' + } + + // We need to order this for the VM. + const acct = new Account(config.address) + if (parseInt(config.script.scriptHash, 16) > parseInt(acct.scriptHash, 16)) { + config.tx.scripts.push(attachInvokedContract) + } else { + config.tx.scripts.unshift(attachInvokedContract) } - config.tx.scripts.push(attachInvokedContract) + return config }) } else { @@ -332,14 +341,14 @@ const attachContractIfExecutingAsSmartContract = config => { return Query.getContractState(smartContractScriptHash) .execute(config.url) .then(contractState => { - const { parameters, script } = contractState.result + const { parameters } = contractState.result const attachInvokedContract = { invocationScript: ('00').repeat(parameters.length), - verificationScript: script + verificationScript: '' } // We need to order this for the VM. - const acct = config.privateKey ? new Account(config.privateKey) : new Account(config.publicKey) + const acct = new Account(config.address) if (parseInt(smartContractScriptHash, 16) > parseInt(acct.scriptHash, 16)) { config.tx.scripts.push(attachInvokedContract) } else {