diff --git a/public/minimal-slp-wallet.min.js b/public/minimal-slp-wallet.min.js new file mode 100644 index 0000000..9c54b8e --- /dev/null +++ b/public/minimal-slp-wallet.min.js @@ -0,0 +1 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SlpWallet=e()}}((function(){for(var define,module,exports,createModuleFactory=function(e){var t;return function(r){return t||e(t={exports:{},parent:r},t.exports),t.exports}},_$defaults_171=createModuleFactory((function(e,t){(function(t){(function(){"use strict";var r={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!_$utils_184.isUndefined(e)&&_$utils_184.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var n,o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(n=_$xhr_157({})),n),transformRequest:[function(e,t){return _$normalizeHeaderName_180(t,"Accept"),_$normalizeHeaderName_180(t,"Content-Type"),_$utils_184.isFormData(e)||_$utils_184.isArrayBuffer(e)||_$utils_184.isBuffer(e)||_$utils_184.isStream(e)||_$utils_184.isFile(e)||_$utils_184.isBlob(e)?e:_$utils_184.isArrayBufferView(e)?e.buffer:_$utils_184.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):_$utils_184.isObject(e)||t&&"application/json"===t["Content-Type"]?(i(t,"application/json"),function(e,t,r){if(_$utils_184.isString(e))try{return(0,JSON.parse)(e),_$utils_184.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||o.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,n=!r&&"json"===this.responseType;if(n||i&&_$utils_184.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(n){if("SyntaxError"===a.name)throw _$enhanceError_167(a,this,"E_JSON_PARSE");throw a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_$utils_184.forEach(["delete","get","head"],(function(e){o.headers[e]={}})),_$utils_184.forEach(["post","put","patch"],(function(e){o.headers[e]=_$utils_184.merge(r)})),e.exports=o}).call(this)}).call(this,_$browser_408)})),_$xhr_157=createModuleFactory((function(e,t){"use strict";var r=_$defaults_171({});e.exports=function(e){return new Promise((function(t,i){var n,o=e.data,a=e.headers,s=e.responseType;function c(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}_$utils_184.isFormData(o)&&delete a["Content-Type"];var u=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(f+":"+h)}var l=_$buildFullPath_164(e.baseURL,e.url);function _(){if(u){var r="getAllResponseHeaders"in u?_$parseHeaders_181(u.getAllResponseHeaders()):null,n={data:s&&"text"!==s&&"json"!==s?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u};_$settle_169((function(e){t(e),c()}),(function(e){i(e),c()}),n),u=null}}if(u.open(e.method.toUpperCase(),_$buildURL_174(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=_:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(_)},u.onabort=function(){u&&(i(_$createError_165("Request aborted",e,"ECONNABORTED",u)),u=null)},u.onerror=function(){i(_$createError_165("Network Error",e,null,u)),u=null},u.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||r.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),i(_$createError_165(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},_$utils_184.isStandardBrowserEnv()){var d=(e.withCredentials||_$isURLSameOrigin_179(l))&&e.xsrfCookieName?_$cookies_176.read(e.xsrfCookieName):void 0;d&&(a[e.xsrfHeaderName]=d)}"setRequestHeader"in u&&_$utils_184.forEach(a,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete a[t]:u.setRequestHeader(t,e)})),_$utils_184.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),s&&"json"!==s&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(n=function(e){u&&(i(!e||e&&e.type?new _$Cancel_159("canceled"):e),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),o||(o=null),u.send(o)}))}})),_$main_468=createModuleFactory((function(e,t){(function(e,r){(function(){var i=_$browser_408.nextTick,n=(Function.prototype.apply,Array.prototype.slice),o={},a=0;function s(e,t){this._id=e,this._clearFn=t}s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},t.setImmediate="function"==typeof e?e:function(e){var r=a++,s=!(arguments.length<2)&&n.call(arguments,1);return o[r]=!0,i((function(){o[r]&&(s?e.apply(null,s):e.call(null),t.clearImmediate(r))})),r},t.clearImmediate="function"==typeof r?r:function(e){delete o[e]}}).call(this)}).call(this,_$main_468({}).setImmediate,_$main_468({}).clearImmediate)})),_$cryptoBrowserify_280=createModuleFactory((function(e,t){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=_$browser_421,t.createHash=t.Hash=_$browser_276,t.createHmac=t.Hmac=_$browser_278;var r=Object.keys(_$algos_239),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);t.getHashes=function(){return i},t.pbkdf2=_$browser_402.pbkdf2,t.pbkdf2Sync=_$browser_402.pbkdf2Sync,t.Cipher=_$browser_234.Cipher,t.createCipher=_$browser_234.createCipher,t.Cipheriv=_$browser_234.Cipheriv,t.createCipheriv=_$browser_234.createCipheriv,t.Decipher=_$browser_234.Decipher,t.createDecipher=_$browser_234.createDecipher,t.Decipheriv=_$browser_234.Decipheriv,t.createDecipheriv=_$browser_234.createDecipheriv,t.getCiphers=_$browser_234.getCiphers,t.listCiphers=_$browser_234.listCiphers,t.DiffieHellmanGroup=_$browser_321.DiffieHellmanGroup,t.createDiffieHellmanGroup=_$browser_321.createDiffieHellmanGroup,t.getDiffieHellman=_$browser_321.getDiffieHellman,t.createDiffieHellman=_$browser_321.createDiffieHellman,t.DiffieHellman=_$browser_321.DiffieHellman,t.createSign=_$browser_242.createSign,t.Sign=_$browser_242.Sign,t.createVerify=_$browser_242.createVerify,t.Verify=_$browser_242.Verify,t.createECDH=_$browser_275,t.publicEncrypt=_$browser_409.publicEncrypt,t.privateEncrypt=_$browser_409.privateEncrypt,t.publicDecrypt=_$browser_409.publicDecrypt,t.privateDecrypt=_$browser_409.privateDecrypt,t.randomFill=_$browser_422.randomFill,t.randomFillSync=_$browser_422.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),_$_stream_readable_249=createModuleFactory((function(e,t){(function(t,r){(function(){"use strict";var i;e.exports=w,w.ReadableState=v,_$events_350.EventEmitter;var n,o=function(e,t){return e.listeners(t).length},a=_$buffer_267({}).Buffer,s=r.Uint8Array||function(){},c=_$empty_216({});n=c&&c.debuglog?c.debuglog("stream"):function(){};var u,f,h,l=_$state_258.getHighWaterMark,_=_$errorsBrowser_246.codes,d=_.ERR_INVALID_ARG_TYPE,p=_.ERR_STREAM_PUSH_AFTER_EOF,m=_.ERR_METHOD_NOT_IMPLEMENTED,b=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_$inherits_browser_388(w,_$streamBrowser_259);var g=_$destroy_254.errorOrDestroy,y=["error","close","destroy","pause","resume"];function v(e,t,r){i=i||_$Duplex_247({}),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=l(this,e,"readableHighWaterMark",r),this.buffer=new _$buffer_list_253,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.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=_$string_decoder_466({}).StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function w(e){if(i=i||_$Duplex_247({}),!(this instanceof w))return new w(e);var t=this instanceof i;this._readableState=new v(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),_$streamBrowser_259.call(this)}function $(e,t,r,i,o){n("readableAddChunk",t);var c,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(n("onEofChunk"),!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,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}(e,u);else if(o||(c=function(e,t){var r,i;return i=t,a.isBuffer(i)||i instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new d("chunk",["string","Buffer","Uint8Array"],t)),r}(u,t)),c)g(e,c);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),i)u.endEmitted?g(e,new b):E(e,u,t,!0);else if(u.ended)g(e,new p);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):k(e,u)):E(e,u,t,!1)}else i||(u.reading=!1,k(e,u));return!u.ended&&(u.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var r=e._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,t.nextTick(B,e))}function B(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,P(e)}function k(e,r){r.readingMore||(r.readingMore=!0,t.nextTick(M,e,r))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){n("readable nexttick read 0"),e.read(0)}function I(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),P(e),t.flowing&&!t.reading&&e.read(0)}function P(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function x(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function O(e){var r=e._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,t.nextTick(C,r,e))}function C(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function N(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,o=t.needReadable;return n("need readable",o),(0===t.length||t.length-e0?x(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},w.prototype._read=function(e){g(this,new m("_read()"))},w.prototype.pipe=function(e,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,r);var s=r&&!1===r.end||e===t.stdout||e===t.stderr?p:c;function c(){n("onend"),e.end()}a.endEmitted?t.nextTick(s):i.once("end",s),e.on("unpipe",(function t(r,o){n("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),e.removeListener("close",_),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",l),e.removeListener("unpipe",t),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",h),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,P(e))}}(i);e.on("drain",u);var f=!1;function h(t){n("ondata");var r=e.write(t);n("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==N(a.pipes,e))&&!f&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function l(t){n("onerror",t),p(),e.removeListener("error",l),0===o(e,"error")&&g(e,t)}function _(){e.removeListener("finish",d),p()}function d(){n("onfinish"),e.removeListener("close",_),p()}function p(){n("unpipe"),i.unpipe(e)}return i.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,l),e.once("close",_),e.once("finish",d),e.emit("pipe",i),a.flowing||(n("pipe resume"),i.resume()),e},w.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||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?A(this):o.reading||t.nextTick(R,this))),i},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,r){var i=_$streamBrowser_259.prototype.removeListener.call(this,e,r);return"readable"===e&&t.nextTick(T,this),i},w.prototype.removeAllListeners=function(e){var r=_$streamBrowser_259.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||t.nextTick(T,this),r},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,r){r.resumeScheduled||(r.resumeScheduled=!0,t.nextTick(I,e,r))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var o in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(i=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a-1))throw new g(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),$.prototype._write=function(e,t,r){r(new l("_write()"))},$.prototype._writev=null,$.prototype.end=function(e,r,i){var n=this._writableState;return"function"==typeof e?(i=e,e=null,r=null):"function"==typeof r&&(i=r,r=null),null!=e&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,r,i){r.ending=!0,M(e,r),i&&(r.finished?t.nextTick(i):e.once("finish",i)),r.ended=!0,e.writable=!1}(this,n,i),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),$.prototype.destroy=_$destroy_254.destroy,$.prototype._undestroy=_$destroy_254.undestroy,$.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$_stream_readable_455=createModuleFactory((function(e,t){(function(t,r){(function(){"use strict";var i;e.exports=w,w.ReadableState=v,_$events_350.EventEmitter;var n,o=function(e,t){return e.listeners(t).length},a=_$buffer_267({}).Buffer,s=r.Uint8Array||function(){},c=_$empty_216({});n=c&&c.debuglog?c.debuglog("stream"):function(){};var u,f,h,l=_$state_464.getHighWaterMark,_=_$errorsBrowser_452.codes,d=_.ERR_INVALID_ARG_TYPE,p=_.ERR_STREAM_PUSH_AFTER_EOF,m=_.ERR_METHOD_NOT_IMPLEMENTED,b=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_$inherits_browser_388(w,_$streamBrowser_465);var g=_$destroy_460.errorOrDestroy,y=["error","close","destroy","pause","resume"];function v(e,t,r){i=i||_$Duplex_453({}),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=l(this,e,"readableHighWaterMark",r),this.buffer=new _$buffer_list_459,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.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=_$string_decoder_466({}).StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function w(e){if(i=i||_$Duplex_453({}),!(this instanceof w))return new w(e);var t=this instanceof i;this._readableState=new v(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),_$streamBrowser_465.call(this)}function $(e,t,r,i,o){n("readableAddChunk",t);var c,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(n("onEofChunk"),!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,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}(e,u);else if(o||(c=function(e,t){var r,i;return i=t,a.isBuffer(i)||i instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new d("chunk",["string","Buffer","Uint8Array"],t)),r}(u,t)),c)g(e,c);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),i)u.endEmitted?g(e,new b):E(e,u,t,!0);else if(u.ended)g(e,new p);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):k(e,u)):E(e,u,t,!1)}else i||(u.reading=!1,k(e,u));return!u.ended&&(u.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var r=e._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,t.nextTick(B,e))}function B(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,P(e)}function k(e,r){r.readingMore||(r.readingMore=!0,t.nextTick(M,e,r))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){n("readable nexttick read 0"),e.read(0)}function I(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),P(e),t.flowing&&!t.reading&&e.read(0)}function P(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function x(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function O(e){var r=e._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,t.nextTick(C,r,e))}function C(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function N(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,o=t.needReadable;return n("need readable",o),(0===t.length||t.length-e0?x(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},w.prototype._read=function(e){g(this,new m("_read()"))},w.prototype.pipe=function(e,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,r);var s=r&&!1===r.end||e===t.stdout||e===t.stderr?p:c;function c(){n("onend"),e.end()}a.endEmitted?t.nextTick(s):i.once("end",s),e.on("unpipe",(function t(r,o){n("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),e.removeListener("close",_),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",l),e.removeListener("unpipe",t),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",h),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,P(e))}}(i);e.on("drain",u);var f=!1;function h(t){n("ondata");var r=e.write(t);n("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==N(a.pipes,e))&&!f&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function l(t){n("onerror",t),p(),e.removeListener("error",l),0===o(e,"error")&&g(e,t)}function _(){e.removeListener("finish",d),p()}function d(){n("onfinish"),e.removeListener("close",_),p()}function p(){n("unpipe"),i.unpipe(e)}return i.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,l),e.once("close",_),e.once("finish",d),e.emit("pipe",i),a.flowing||(n("pipe resume"),i.resume()),e},w.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||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?A(this):o.reading||t.nextTick(R,this))),i},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,r){var i=_$streamBrowser_465.prototype.removeListener.call(this,e,r);return"readable"===e&&t.nextTick(T,this),i},w.prototype.removeAllListeners=function(e){var r=_$streamBrowser_465.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||t.nextTick(T,this),r},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,r){r.resumeScheduled||(r.resumeScheduled=!0,t.nextTick(I,e,r))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var o in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(i=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a-1))throw new g(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),$.prototype._write=function(e,t,r){r(new l("_write()"))},$.prototype._writev=null,$.prototype.end=function(e,r,i){var n=this._writableState;return"function"==typeof e?(i=e,e=null,r=null):"function"==typeof r&&(i=r,r=null),null!=e&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,r,i){r.ending=!0,M(e,r),i&&(r.finished?t.nextTick(i):e.once("finish",i)),r.ended=!0,e.writable=!1}(this,n,i),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),$.prototype.destroy=_$destroy_460.destroy,$.prototype._undestroy=_$destroy_460.undestroy,$.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$_stream_readable_362=createModuleFactory((function(e,t){(function(t,r){(function(){"use strict";var i;e.exports=w,w.ReadableState=v,_$events_350.EventEmitter;var n,o=function(e,t){return e.listeners(t).length},a=_$buffer_267({}).Buffer,s=r.Uint8Array||function(){},c=_$empty_216({});n=c&&c.debuglog?c.debuglog("stream"):function(){};var u,f,h,l=_$state_371.getHighWaterMark,_=_$errorsBrowser_359.codes,d=_.ERR_INVALID_ARG_TYPE,p=_.ERR_STREAM_PUSH_AFTER_EOF,m=_.ERR_METHOD_NOT_IMPLEMENTED,b=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_$inherits_browser_388(w,_$streamBrowser_372);var g=_$destroy_367.errorOrDestroy,y=["error","close","destroy","pause","resume"];function v(e,t,r){i=i||_$Duplex_360({}),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=l(this,e,"readableHighWaterMark",r),this.buffer=new _$buffer_list_366,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.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=_$string_decoder_466({}).StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function w(e){if(i=i||_$Duplex_360({}),!(this instanceof w))return new w(e);var t=this instanceof i;this._readableState=new v(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),_$streamBrowser_372.call(this)}function $(e,t,r,i,o){n("readableAddChunk",t);var c,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(n("onEofChunk"),!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,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}(e,u);else if(o||(c=function(e,t){var r,i;return i=t,a.isBuffer(i)||i instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new d("chunk",["string","Buffer","Uint8Array"],t)),r}(u,t)),c)g(e,c);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),i)u.endEmitted?g(e,new b):E(e,u,t,!0);else if(u.ended)g(e,new p);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):k(e,u)):E(e,u,t,!1)}else i||(u.reading=!1,k(e,u));return!u.ended&&(u.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var r=e._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,t.nextTick(B,e))}function B(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,P(e)}function k(e,r){r.readingMore||(r.readingMore=!0,t.nextTick(M,e,r))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){n("readable nexttick read 0"),e.read(0)}function I(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),P(e),t.flowing&&!t.reading&&e.read(0)}function P(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function x(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function O(e){var r=e._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,t.nextTick(C,r,e))}function C(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function N(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,o=t.needReadable;return n("need readable",o),(0===t.length||t.length-e0?x(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},w.prototype._read=function(e){g(this,new m("_read()"))},w.prototype.pipe=function(e,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,r);var s=r&&!1===r.end||e===t.stdout||e===t.stderr?p:c;function c(){n("onend"),e.end()}a.endEmitted?t.nextTick(s):i.once("end",s),e.on("unpipe",(function t(r,o){n("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),e.removeListener("close",_),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",l),e.removeListener("unpipe",t),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",h),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,P(e))}}(i);e.on("drain",u);var f=!1;function h(t){n("ondata");var r=e.write(t);n("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==N(a.pipes,e))&&!f&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function l(t){n("onerror",t),p(),e.removeListener("error",l),0===o(e,"error")&&g(e,t)}function _(){e.removeListener("finish",d),p()}function d(){n("onfinish"),e.removeListener("close",_),p()}function p(){n("unpipe"),i.unpipe(e)}return i.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,l),e.once("close",_),e.once("finish",d),e.emit("pipe",i),a.flowing||(n("pipe resume"),i.resume()),e},w.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||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?A(this):o.reading||t.nextTick(R,this))),i},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,r){var i=_$streamBrowser_372.prototype.removeListener.call(this,e,r);return"readable"===e&&t.nextTick(T,this),i},w.prototype.removeAllListeners=function(e){var r=_$streamBrowser_372.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||t.nextTick(T,this),r},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,r){r.resumeScheduled||(r.resumeScheduled=!0,t.nextTick(I,e,r))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var o in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(i=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);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 s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}t.StringDecoder=n,n.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=0?(n>0&&(e.lastNeed=n-1),n):--i=0?(n>0&&(e.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}})),_$Duplex_360=createModuleFactory((function(e,t){(function(t){(function(){"use strict";var r=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=_$_stream_readable_362({}),n=_$_stream_writable_364({});_$inherits_browser_388(c,i);for(var o=r(n.prototype),a=0;a-1))throw new g(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),$.prototype._write=function(e,t,r){r(new l("_write()"))},$.prototype._writev=null,$.prototype.end=function(e,r,i){var n=this._writableState;return"function"==typeof e?(i=e,e=null,r=null):"function"==typeof r&&(i=r,r=null),null!=e&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,r,i){r.ending=!0,M(e,r),i&&(r.finished?t.nextTick(i):e.once("finish",i)),r.ended=!0,e.writable=!1}(this,n,i),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),$.prototype.destroy=_$destroy_367.destroy,$.prototype._undestroy=_$destroy_367.undestroy,$.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$empty_216=createModuleFactory((function(e,t){})),_$buffer_267=createModuleFactory((function(e,t){(function(e){(function(){"use strict";t.Buffer=r,t.SlowBuffer=function(e){return+e!=e&&(e=0),r.alloc(+e)},t.INSPECT_MAX_BYTES=50;function e(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=r.prototype,t}function r(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return o(e)}return i(e,t,r)}function i(t,i,n){if("string"==typeof t)return function(t,i){if("string"==typeof i&&""!==i||(i="utf8"),!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var n=0|c(t,i),o=e(n),a=o.write(t,i);return a!==n&&(o=o.slice(0,a)),o}(t,i);if(ArrayBuffer.isView(t))return a(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function c(e,t){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||C(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return x(e).length;default:if(o)return n?-1:P(e).length;t=(""+t).toLowerCase(),o=!0}}function u(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function f(e,t,i,n,o){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),N(i=+i)&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(o)return-1;i=e.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof t&&(t=r.from(t,n)),r.isBuffer(t))return 0===t.length?-1:h(e,t,i,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):h(e,[t],i,n,o);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,i,n){var o,a=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var f=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var h=!0,l=0;ln&&(i=n):i=n;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function g(e,t,r){return 0===t&&r===e.length?_$base64Js_150.fromByteArray(e):_$base64Js_150.fromByteArray(e.slice(t,r))}function y(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(o=e[n+1]))&&(c=(31&u)<<6|63&o)>127&&(f=c);break;case 3:o=e[n+1],a=e[n+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:o=e[n+1],a=e[n+2],s=e[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,h=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=h}return function(e){var t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);for(var r="",i=0;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return $(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),""},r.prototype.compare=function(e,t,i,n,o){if(C(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),s=(i>>>=0)-(t>>>=0),c=Math.min(a,s),u=this.slice(n,o),f=e.slice(t,i),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return l(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return d(this,e,t,r);case"latin1":case"binary":return p(this,e,t,r);case"base64":return m(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ni)&&(r=i);for(var n="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,i,n,o,a){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function k(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,i,n){return t=+t,r>>>=0,n||k(e,0,r,4),_$ieee754_387.write(e,t,r,i,23,4),r+4}function T(e,t,r,i,n){return t=+t,r>>>=0,n||k(e,0,r,8),_$ieee754_387.write(e,t,r,i,52,8),r+8}r.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},r.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*t)),i},r.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var i=t,n=1,o=this[e+--i];i>0&&(n*=256);)o+=this[e+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),_$ieee754_387.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),_$ieee754_387.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),_$ieee754_387.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),_$ieee754_387.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||B(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||B(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},r.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},r.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},r.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},r.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},r.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},r.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},r.prototype.writeDoubleLE=function(e,t,r){return T(this,e,t,!0,r)},r.prototype.writeDoubleBE=function(e,t,r){return T(this,e,t,!1,r)},r.prototype.copy=function(e,t,i,n){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--a)e[a+t]=this[a+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return o},r.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function x(e){return _$base64Js_150.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function N(e){return e!=e}}).call(this)}).call(this,_$buffer_267({}).Buffer)})),_$base64Js_150={toByteArray:function(e){var t,r,i=getLens(e),n=i[0],o=i[1],a=new Arr(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),s=0,c=o>0?n-4:n;for(r=0;r>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===o&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===o&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a},fromByteArray:function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;oa?a:o+16383));return 1===i?(t=e[r-1],n.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),n.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,r){for(var i,n,o=[],a=t;a>18&63]+lookup[n>>12&63]+lookup[n>>6&63]+lookup[63&n]);return o.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_387={read:function(e,t,r,i,n){var o,a,s=8*n-i-1,c=(1<>1,f=-7,h=r?n-1:0,l=r?-1:1,_=e[t+h];for(h+=l,o=_&(1<<-f)-1,_>>=-f,f+=s;f>0;o=256*o+e[t+h],h+=l,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=i;f>0;a=256*a+e[t+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(_?-1:1);a+=Math.pow(2,i),o-=u}return(_?-1:1)*a*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var a,s,c,u=8*o-n-1,f=(1<>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=i?0:o-1,d=i?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(t*c-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[r+_]=255&s,_+=d,s/=256,n-=8);for(a=a<0;e[r+_]=255&a,_+=d,a/=256,u-=8);e[r+_-d]|=128*p}},_$safeBuffer_424={},buffer=_$buffer_267({}),Buffer=buffer.Buffer;function copyProps(e,t){for(var r in e)t[r]=e[r]}function SafeBuffer(e,t,r){return Buffer(e,t,r)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?_$safeBuffer_424=buffer:(copyProps(buffer,_$safeBuffer_424),_$safeBuffer_424.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(Buffer.prototype),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Buffer(e,t,r)},SafeBuffer.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=Buffer(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},SafeBuffer.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Buffer(e)},SafeBuffer.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(e)};var __Buffer_212=_$safeBuffer_424.Buffer,_$bip66_212={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var n=__Buffer_212.allocUnsafe(6+r+i);return n[0]=48,n[1]=n.length-2,n[2]=2,n[3]=e.length,e.copy(n,4),n[4+r]=2,n[5+r]=t.length,t.copy(n,6+r),n}},_$index_45={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKDATASIG:186,OP_CHECKDATASIGVERIFY:187,OP_REVERSEBYTES:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};function encodingLength(e){return e<_$index_45.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var _$pushdataBitcoin_104={encodingLength:encodingLength,encode:function(e,t,r){var i=encodingLength(t);return 1===i?e.writeUInt8(t,r):2===i?(e.writeUInt8(_$index_45.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===i?(e.writeUInt8(_$index_45.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(_$index_45.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),i},decode:function(e,t){var r,i,n=e.readUInt8(t);if(n<_$index_45.OP_PUSHDATA1)r=n,i=1;else if(n===_$index_45.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),i=2}else if(n===_$index_45.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),i=3}else{if(t+5>e.length)return null;if(n!==_$index_45.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),i=5}return{opcode:n,number:r,size:i}}},types={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var typeName in types.Null=types.Nil,types)types[typeName].toJSON=function(e){return e}.bind(null,typeName);var _$types_472=types,_$errors_469={};function getTypeName(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function getValueTypeName(e){return _$types_472.Nil(e)?"":getTypeName(e.constructor)}function captureStackTrace(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function tfJSON(e){return _$types_472.Function(e)?e.toJSON?e.toJSON():getTypeName(e):_$types_472.Array(e)?"Array":e&&_$types_472.Object(e)?"Object":void 0!==e?e:""}function tfErrorString(e,t,r){var i=function(e){return _$types_472.Function(e)?"":_$types_472.String(e)?JSON.stringify(e):e&&_$types_472.Object(e)?"":e}(t);return"Expected "+tfJSON(e)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function TfTypeError(e,t,r){r=r||getValueTypeName(t),this.message=tfErrorString(e,t,r),captureStackTrace(this,TfTypeError),this.__type=e,this.__value=t,this.__valueTypeName=r}function TfPropertyTypeError(e,t,r,i,n){e?(n=n||getValueTypeName(i),this.message=function(e,t,r,i,n){var o='" of type ';return"key"===t&&(o='" with key type '),tfErrorString('property "'+tfJSON(r)+o+tfJSON(e),i,n)}(e,r,t,i,n)):this.message='Unexpected property "'+t+'"',captureStackTrace(this,TfTypeError),this.__label=r,this.__property=t,this.__type=e,this.__value=i,this.__valueTypeName=n}function isBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}TfTypeError.prototype=Object.create(Error.prototype),TfTypeError.prototype.constructor=TfTypeError,TfPropertyTypeError.prototype=Object.create(Error.prototype),TfPropertyTypeError.prototype.constructor=TfTypeError,_$errors_469={TfTypeError:TfTypeError,TfPropertyTypeError:TfPropertyTypeError,tfCustomError:function(e,t){return new TfTypeError(e,{},t)},tfSubError:function(e,t,r){return e instanceof TfPropertyTypeError?(t=t+"."+e.__property,e=new TfPropertyTypeError(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof TfTypeError&&(e=new TfPropertyTypeError(e.__type,t,r,e.__value,e.__valueTypeName)),captureStackTrace(e),e},tfJSON:tfJSON,getValueTypeName:getValueTypeName};var _$isBuffer_389=function(e){return null!=e&&(isBuffer(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isBuffer(e.slice(0,0))}(e)||!!e._isBuffer)},_$types_470={};(function(e){(function(){function t(t){return e.isBuffer(t)}function r(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function i(e,t){var r=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw _$errors_469.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+i.length+")")}return i.toJSON=function(){return r},i}var n=i.bind(null,_$types_472.Array),o=i.bind(null,t),a=i.bind(null,r),s=i.bind(null,_$types_472.String),c=Math.pow(2,53)-1,u={ArrayN:n,Buffer:t,BufferN:o,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:r,HexN:a,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-c&&e<=c&&Math.floor(e)===e},Range:function(e,t,r){function i(i,n){return r(i,n)&&i>e&&i>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=c&&Math.floor(e)===e}};for(var f in u)u[f].toJSON=function(e){return e}.bind(null,f);_$types_470=u}).call(this)}).call(this,{isBuffer:_$isBuffer_389});var _$typeforce_471={},__tfJSON_471=_$errors_469.tfJSON,__TfTypeError_471=_$errors_469.TfTypeError,__TfPropertyTypeError_471=_$errors_469.TfPropertyTypeError,tfSubError=_$errors_469.tfSubError,__getValueTypeName_471=_$errors_469.getValueTypeName,TYPES={arrayOf:function(e,t){function r(r,i){return!!_$types_472.Array(r)&&!_$types_472.Nil(r)&&!(void 0!==t.minLength&&r.lengtht.maxLength)&&(void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return typeforce(e,t,i)}catch(n){throw tfSubError(n,r)}}))}return e=compile(e),t=t||{},r.toJSON=function(){var r="["+__tfJSON_471(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,i){return _$types_472.Nil(r)||t(r,i,e)}return t=compile(t),r.toJSON=function(){return"?"+__tfJSON_471(t)},r},map:function(e,t){function r(r,i){if(!_$types_472.Object(r))return!1;if(_$types_472.Nil(r))return!1;for(var n in r){try{t&&typeforce(t,n,i)}catch(a){throw tfSubError(a,n,"key")}try{var o=r[n];typeforce(e,o,i)}catch(a){throw tfSubError(a,n)}}return!0}return e=compile(e),t&&(t=compile(t)),r.toJSON=t?function(){return"{"+__tfJSON_471(t)+": "+__tfJSON_471(e)+"}"}:function(){return"{"+__tfJSON_471(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=compile(e[r]);function i(e,r){if(!_$types_472.Object(e))return!1;if(_$types_472.Nil(e))return!1;var i;try{for(i in t)typeforce(t[i],e[i],r)}catch(n){throw tfSubError(n,i)}if(r)for(i in e)if(!t[i])throw new __TfPropertyTypeError_471(void 0,i);return!0}return i.toJSON=function(){return __tfJSON_471(t)},i},anyOf:function(){var e=[].slice.call(arguments).map(compile);function t(t,r){return e.some((function(e){try{return typeforce(e,t,r)}catch(i){return!1}}))}return t.toJSON=function(){return e.map(__tfJSON_471).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(compile);function t(t,r){return e.every((function(e){try{return typeforce(e,t,r)}catch(i){return!1}}))}return t.toJSON=function(){return e.map(__tfJSON_471).join(" & ")},t},quacksLike:function(e){function t(t){return e===__getValueTypeName_471(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(compile);function t(t,r){return!_$types_472.Nil(t)&&!_$types_472.Nil(t.length)&&(!r||t.length===e.length)&&e.every((function(e,i){try{return typeforce(e,t[i],r)}catch(n){throw tfSubError(n,i)}}))}return t.toJSON=function(){return"("+e.map(__tfJSON_471).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function compile(e){if(_$types_472.String(e))return"?"===e[0]?TYPES.maybe(e.slice(1)):_$types_472[e]||TYPES.quacksLike(e);if(e&&_$types_472.Object(e)){if(_$types_472.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return TYPES.arrayOf(e[0])}return TYPES.object(e)}return _$types_472.Function(e)?e:TYPES.value(e)}function typeforce(e,t,r,i){if(_$types_472.Function(e)){if(e(t,r))return!0;throw new __TfTypeError_471(i||e,t)}return typeforce(compile(e),t,r)}for(var __typeName_471 in TYPES.oneOf=TYPES.anyOf,_$types_472)typeforce[__typeName_471]=_$types_472[__typeName_471];for(__typeName_471 in TYPES)typeforce[__typeName_471]=TYPES[__typeName_471];for(__typeName_471 in _$types_470)typeforce[__typeName_471]=_$types_470[__typeName_471];typeforce.compile=compile,typeforce.TfTypeError=__TfTypeError_471,typeforce.TfPropertyTypeError=__TfPropertyTypeError_471,_$typeforce_471=typeforce;var UINT31_MAX=Math.pow(2,31)-1;function BIP32Path(e){return _$typeforce_471.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}BIP32Path.toJSON=function(){return"BIP32 derivation path"};var SATOSHI_MAX=21e14,__BigInt_85=_$typeforce_471.quacksLike("BigInteger"),ECPoint=_$typeforce_471.quacksLike("Point"),ECSignature=_$typeforce_471.compile({r:__BigInt_85,s:__BigInt_85}),Network=_$typeforce_471.compile({messagePrefix:_$typeforce_471.oneOf(_$typeforce_471.Buffer,_$typeforce_471.String),bip32:{public:_$typeforce_471.UInt32,private:_$typeforce_471.UInt32},pubKeyHash:_$typeforce_471.UInt8,scriptHash:_$typeforce_471.UInt8,wif:_$typeforce_471.UInt8}),__types_85={BigInt:__BigInt_85,BIP32Path:BIP32Path,Buffer256bit:_$typeforce_471.BufferN(32),ECPoint:ECPoint,ECSignature:ECSignature,Hash160bit:_$typeforce_471.BufferN(20),Hash256bit:_$typeforce_471.BufferN(32),Network:Network,Satoshi:function(e){return _$typeforce_471.UInt53(e)&&e<=SATOSHI_MAX},UInt31:function(e){return _$typeforce_471.UInt32(e)&&e<=UINT31_MAX}};for(var __typeName_85 in _$typeforce_471)__types_85[__typeName_85]=_$typeforce_471[__typeName_85];var _$types_85=__types_85,map={};for(var op in _$index_45)map[_$index_45[op]]=op;var _$map_46=map,__Buffer_60=_$safeBuffer_424.Buffer,_$script_number_60={decode:function(e,t,r){t=t||4,r=void 0===r||r;var i=e.length;if(0===i)return 0;if(i>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[i-1])&&(i<=1||0==(128&e[i-2])))throw new Error("Non-minimally encoded script number");if(5===i){var n=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+n):4294967296*o+n}for(var a=0,s=0;s2147483647?5:e>8388607?4:e>32767?3:e>127?2:e>0?1:0}(t),i=__Buffer_60.allocUnsafe(r),n=e<0,o=0;o>=8;return 128&i[r-1]?i.writeUInt8(n?128:0,r-1):n&&(i[r-1]|=128),i}},__Buffer_59=_$safeBuffer_424.Buffer,OP_INT_BASE=_$index_45.OP_RESERVED;function isPushOnlyChunk(e){return _$types_85.Buffer(e)||function(e){return _$types_85.Number(e)&&(e===_$index_45.OP_0||e>=_$index_45.OP_1&&e<=_$index_45.OP_16||e===_$index_45.OP_1NEGATE)}(e)}function isPushOnly(e){return _$types_85.Array(e)&&e.every(isPushOnlyChunk)}function asMinimalOP(e){return 0===e.length?_$index_45.OP_0:1===e.length?e[0]>=1&&e[0]<=16?OP_INT_BASE+e[0]:129===e[0]?_$index_45.OP_1NEGATE:void 0:void 0}function __compile_59(e){if(__Buffer_59.isBuffer(e))return e;_$typeforce_471(_$types_85.Array,e);var t=e.reduce((function(e,t){return __Buffer_59.isBuffer(t)?1===t.length&&void 0!==asMinimalOP(t)?e+1:e+_$pushdataBitcoin_104.encodingLength(t.length)+t.length:e+1}),0),r=__Buffer_59.allocUnsafe(t),i=0;if(e.forEach((function(e){if(__Buffer_59.isBuffer(e)){var t=asMinimalOP(e);if(void 0!==t)return r.writeUInt8(t,i),void(i+=1);i+=_$pushdataBitcoin_104.encode(r,e.length,i),e.copy(r,i),i+=e.length}else r.writeUInt8(e,i),i+=1})),i!==r.length)throw new Error("Could not decode chunks");return r}function decompile(e){if(_$types_85.Array(e))return e;_$typeforce_471(_$types_85.Buffer,e);for(var t=[],r=0;r_$index_45.OP_0&&i<=_$index_45.OP_PUSHDATA4){var n=_$pushdataBitcoin_104.decode(e,r);if(null===n)return[];r+=n.size;var o=e.slice(r,r+n.number);r+=n.number;var a=asMinimalOP(o);void 0!==a?t.push(a):t.push(o)}else t.push(i),r+=1}return t}function isDefinedHashType(e){var t=-193&e;return t>0&&t<4}var _$script_59={compile:__compile_59,compile2:function(e){if(__Buffer_59.isBuffer(e))return e;var t=e.reduce((function(e,t){return __Buffer_59.isBuffer(t)?e+_$pushdataBitcoin_104.encodingLength(t.length)+t.length:e+1}),0),r=__Buffer_59.allocUnsafe(t),i=0;if(e.forEach((function(e,t){__Buffer_59.isBuffer(e)?(i+=_$pushdataBitcoin_104.encode(r,e.length,i),e.copy(r,i),i+=e.length):(r.writeUInt8(e,i),i+=1)})),i!==r.length)throw new Error("Could not decode chunks");return r},decompile:decompile,fromASM:function(e){return _$typeforce_471(_$types_85.String,e),__compile_59(e.split(" ").map((function(e){return void 0!==_$index_45[e]?_$index_45[e]:__Buffer_59.from(e,"hex")})))},toASM:function(e){return __Buffer_59.isBuffer(e)&&(e=decompile(e)),e.map((function(e){if(__Buffer_59.isBuffer(e)){var t=asMinimalOP(e);if(void 0===t)return e.toString("hex");e=t}return _$map_46[e]})).join(" ")},toStack:function(e){return e=decompile(e),_$typeforce_471(isPushOnly,e),e.map((function(e){return __Buffer_59.isBuffer(e)?e:e===_$index_45.OP_0?__Buffer_59.allocUnsafe(0):_$script_number_60.encode(e-OP_INT_BASE)}))},number:_$script_number_60,isCanonicalPubKey:function(e){if(!__Buffer_59.isBuffer(e))return!1;if(e.length<33)return!1;switch(e[0]){case 2:case 3:return 33===e.length;case 4:return 65===e.length}return!1},isCanonicalSignature:function(e){return!!__Buffer_59.isBuffer(e)&&!!isDefinedHashType(e[e.length-1])&&(65===e.length||_$bip66_212.check(e.slice(0,-1)))},isPushOnly:isPushOnly,isDefinedHashType:isDefinedHashType},_$output_64={},__OP_INT_BASE_64=_$index_45.OP_RESERVED;function check(e,t){var r=_$script_59.decompile(e);if(r.length<4)return!1;if(r[r.length-1]!==_$index_45.OP_CHECKMULTISIG)return!1;if(!_$types_85.Number(r[0]))return!1;if(!_$types_85.Number(r[r.length-2]))return!1;var i=r[0]-__OP_INT_BASE_64,n=r[r.length-2]-__OP_INT_BASE_64;return!(i<=0)&&!(n>16)&&!(i>n)&&n===r.length-3&&(!!t||r.slice(1,-2).every(_$script_59.isCanonicalPubKey))}check.toJSON=function(){return"multi-sig output"},_$output_64={check:check,decode:function(e,t){var r=_$script_59.decompile(e);return _$typeforce_471(check,r,t),{m:r[0]-__OP_INT_BASE_64,pubKeys:r.slice(1,-2)}},encode:function(e,t){_$typeforce_471({m:_$types_85.Number,pubKeys:[_$script_59.isCanonicalPubKey]},{m:e,pubKeys:t});var r=t.length;if(rr.pubKeys.length)throw new TypeError("Too many signatures provided")}return[].concat(EMPTY_BUFFER,e.map((function(e){return e===_$index_45.OP_0?EMPTY_BUFFER:e})))}function decodeStack(e,t){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(__check_63,e,t),e.slice(1)}var _$input_63={check:__check_63,decode:function(e,t){return decodeStack(_$script_59.decompile(e),t)},decodeStack:decodeStack,encode:function(e,t){return _$script_59.compile(encodeStack(e,t))},encodeStack:encodeStack},_$multisig_62={input:_$input_63,output:_$output_64},_$nulldata_65={};function __check_65(e){var t=_$script_59.compile(e);return t.length>1&&t[0]===_$index_45.OP_RETURN}__check_65.toJSON=function(){return"null data output"},_$nulldata_65={output:{check:__check_65,decode:function(e){return _$typeforce_471(__check_65,e),e.slice(2)},encode:function(e){return _$typeforce_471(_$types_85.Buffer,e),_$script_59.compile([_$index_45.OP_RETURN,e])}}};var _$input_67={};function __check_67(e){var t=_$script_59.decompile(e);return 1===t.length&&_$script_59.isCanonicalSignature(t[0])}function __encodeStack_67(e){return _$typeforce_471(_$script_59.isCanonicalSignature,e),[e]}function __decodeStack_67(e){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(__check_67,e),e[0]}__check_67.toJSON=function(){return"pubKey input"},_$input_67={check:__check_67,decode:function(e){return __decodeStack_67(_$script_59.decompile(e))},decodeStack:__decodeStack_67,encode:function(e){return _$script_59.compile(__encodeStack_67(e))},encodeStack:__encodeStack_67};var _$output_68={};function __check_68(e){var t=_$script_59.decompile(e);return 2===t.length&&_$script_59.isCanonicalPubKey(t[0])&&t[1]===_$index_45.OP_CHECKSIG}__check_68.toJSON=function(){return"pubKey output"},_$output_68={check:__check_68,decode:function(e){var t=_$script_59.decompile(e);return _$typeforce_471(__check_68,t),t[0]},encode:function(e){return _$typeforce_471(_$script_59.isCanonicalPubKey,e),_$script_59.compile([e,_$index_45.OP_CHECKSIG])}};var _$pubkey_66={input:_$input_67,output:_$output_68},_$input_70={};function __check_70(e){var t=_$script_59.decompile(e);return 2===t.length&&_$script_59.isCanonicalSignature(t[0])&&_$script_59.isCanonicalPubKey(t[1])}function __encodeStack_70(e,t){return _$typeforce_471({signature:_$script_59.isCanonicalSignature,pubKey:_$script_59.isCanonicalPubKey},{signature:e,pubKey:t}),[e,t]}function __decodeStack_70(e){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(__check_70,e),{signature:e[0],pubKey:e[1]}}__check_70.toJSON=function(){return"pubKeyHash input"},_$input_70={check:__check_70,decode:function(e){return __decodeStack_70(_$script_59.decompile(e))},decodeStack:__decodeStack_70,encode:function(e,t){return _$script_59.compile(__encodeStack_70(e,t))},encodeStack:__encodeStack_70};var _$output_71={};function __check_71(e){var t=_$script_59.compile(e);return 25===t.length&&t[0]===_$index_45.OP_DUP&&t[1]===_$index_45.OP_HASH160&&20===t[2]&&t[23]===_$index_45.OP_EQUALVERIFY&&t[24]===_$index_45.OP_CHECKSIG}__check_71.toJSON=function(){return"pubKeyHash output"},_$output_71={check:__check_71,decode:function(e){return _$typeforce_471(__check_71,e),e.slice(3,23)},encode:function(e){return _$typeforce_471(_$types_85.Hash160bit,e),_$script_59.compile([_$index_45.OP_DUP,_$index_45.OP_HASH160,e,_$index_45.OP_EQUALVERIFY,_$index_45.OP_CHECKSIG])}};var _$pubkeyhash_69={input:_$input_70,output:_$output_71},_$output_79={};function __check_79(e){var t=_$script_59.compile(e);return 22===t.length&&t[0]===_$index_45.OP_0&&20===t[1]}__check_79.toJSON=function(){return"Witness pubKeyHash output"},_$output_79={check:__check_79,decode:function(e){return _$typeforce_471(__check_79,e),e.slice(2)},encode:function(e){return _$typeforce_471(_$types_85.Hash160bit,e),_$script_59.compile([_$index_45.OP_0,e])}};var _$output_82={};function __check_82(e){var t=_$script_59.compile(e);return 34===t.length&&t[0]===_$index_45.OP_0&&32===t[1]}__check_82.toJSON=function(){return"Witness scriptHash output"},_$output_82={check:__check_82,decode:function(e){return _$typeforce_471(__check_82,e),e.slice(2)},encode:function(e){return _$typeforce_471(_$types_85.Hash256bit,e),_$script_59.compile([_$index_45.OP_0,e])}};var _$input_73={},__Buffer_73=_$safeBuffer_424.Buffer;function __check_73(e,t){var r=_$script_59.decompile(e);if(r.length<1)return!1;var i=r[r.length-1];if(!__Buffer_73.isBuffer(i))return!1;var n=_$script_59.decompile(_$script_59.compile(r.slice(0,-1))),o=_$script_59.decompile(i);return 0!==o.length&&!!_$script_59.isPushOnly(n)&&(1===r.length?_$output_82.check(o)||_$output_79.check(o):!(!_$pubkeyhash_69.input.check(n)||!_$pubkeyhash_69.output.check(o))||!(!_$multisig_62.input.check(n,t)||!_$multisig_62.output.check(o))||!(!_$pubkey_66.input.check(n)||!_$pubkey_66.output.check(o)))}function __encodeStack_73(e,t){var r=_$script_59.compile(t);return[].concat(e,r)}function __decodeStack_73(e){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(__check_73,e),{redeemScriptStack:e.slice(0,-1),redeemScript:e[e.length-1]}}__check_73.toJSON=function(){return"scriptHash input"},_$input_73={check:__check_73,decode:function(e){var t=__decodeStack_73(_$script_59.decompile(e));return t.redeemScriptSig=_$script_59.compile(t.redeemScriptStack),delete t.redeemScriptStack,t},decodeStack:__decodeStack_73,encode:function(e,t){var r=_$script_59.decompile(e);return _$script_59.compile(__encodeStack_73(r,t))},encodeStack:__encodeStack_73};var _$output_74={};function __check_74(e){var t=_$script_59.compile(e);return 23===t.length&&t[0]===_$index_45.OP_HASH160&&20===t[1]&&t[22]===_$index_45.OP_EQUAL}__check_74.toJSON=function(){return"scriptHash output"},_$output_74={check:__check_74,decode:function(e){return _$typeforce_471(__check_74,e),e.slice(2,22)},encode:function(e){return _$typeforce_471(_$types_85.Hash160bit,e),_$script_59.compile([_$index_45.OP_HASH160,e,_$index_45.OP_EQUAL])}};var _$scripthash_72={input:_$input_73,output:_$output_74},_$input_78={};function isCompressedCanonicalPubKey(e){return _$script_59.isCanonicalPubKey(e)&&33===e.length}function __check_78(e){var t=_$script_59.decompile(e);return 2===t.length&&_$script_59.isCanonicalSignature(t[0])&&isCompressedCanonicalPubKey(t[1])}__check_78.toJSON=function(){return"witnessPubKeyHash input"},_$input_78={check:__check_78,decodeStack:function(e){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(__check_78,e),{signature:e[0],pubKey:e[1]}},encodeStack:function(e,t){return _$typeforce_471({signature:_$script_59.isCanonicalSignature,pubKey:isCompressedCanonicalPubKey},{signature:e,pubKey:t}),[e,t]}};var _$witnesspubkeyhash_77={input:_$input_78,output:_$output_79},_$input_81={};(function(e){(function(){function t(t,r){if(_$typeforce_471(_$types_85.Array,t),t.length<1)return!1;var i=t[t.length-1];if(!e.isBuffer(i))return!1;var n=_$script_59.decompile(i);if(0===n.length)return!1;var o=_$script_59.compile(t.slice(0,-1));return!(!_$pubkeyhash_69.input.check(o)||!_$pubkeyhash_69.output.check(n))||!(!_$multisig_62.input.check(o,r)||!_$multisig_62.output.check(n))||!(!_$pubkey_66.input.check(o)||!_$pubkey_66.output.check(n))}t.toJSON=function(){return"witnessScriptHash input"},_$input_81={check:t,decodeStack:function(e){return _$typeforce_471(_$typeforce_471.Array,e),_$typeforce_471(t,e),{witnessData:e.slice(0,-1),witnessScript:e[e.length-1]}},encodeStack:function(e,t){return _$typeforce_471({witnessData:[_$types_85.Buffer],witnessScript:_$types_85.Buffer},{witnessData:e,witnessScript:t}),[].concat(e,t)}}}).call(this)}).call(this,{isBuffer:_$isBuffer_389});var _$witnessscripthash_80={input:_$input_81,output:_$output_82},_$output_76={},__Buffer_76=_$safeBuffer_424.Buffer,HEADER=__Buffer_76.from("aa21a9ed","hex");function __check_76(e){var t=_$script_59.compile(e);return t.length>37&&t[0]===_$index_45.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(HEADER)}__check_76.toJSON=function(){return"Witness commitment output"},_$output_76={check:__check_76,decode:function(e){return _$typeforce_471(__check_76,e),_$script_59.decompile(e)[1].slice(4,36)},encode:function(e){_$typeforce_471(_$types_85.Hash256bit,e);var t=__Buffer_76.allocUnsafe(36);return HEADER.copy(t,0),e.copy(t,4),_$script_59.compile([_$index_45.OP_RETURN,t])}};for(var _$witnesscommitment_75={output:_$output_76},__decompile_61=_$script_59.decompile,__types_61={MULTISIG:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"},_$templates_61={classifyInput:function(e,t){var r=__decompile_61(e);return _$pubkeyhash_69.input.check(r)?__types_61.P2PKH:_$scripthash_72.input.check(r,t)?__types_61.P2SH:_$multisig_62.input.check(r,t)?__types_61.MULTISIG:_$pubkey_66.input.check(r)?__types_61.P2PK:__types_61.NONSTANDARD},classifyOutput:function(e){if(_$witnesspubkeyhash_77.output.check(e))return __types_61.P2WPKH;if(_$witnessscripthash_80.output.check(e))return __types_61.P2WSH;if(_$pubkeyhash_69.output.check(e))return __types_61.P2PKH;if(_$scripthash_72.output.check(e))return __types_61.P2SH;var t=__decompile_61(e);return _$multisig_62.output.check(t)?__types_61.MULTISIG:_$pubkey_66.output.check(t)?__types_61.P2PK:_$witnesscommitment_75.output.check(t)?__types_61.WITNESS_COMMITMENT:_$nulldata_65.output.check(t)?__types_61.NULLDATA:__types_61.NONSTANDARD},classifyWitness:function(e,t){var r=__decompile_61(e);return _$witnesspubkeyhash_77.input.check(r)?__types_61.P2WPKH:_$witnessscripthash_80.input.check(r,t)?__types_61.P2WSH:__types_61.NONSTANDARD},multisig:_$multisig_62,nullData:_$nulldata_65,pubKey:_$pubkey_66,pubKeyHash:_$pubkeyhash_69,scriptHash:_$scripthash_72,witnessPubKeyHash:_$witnesspubkeyhash_77,witnessScriptHash:_$witnessscripthash_80,witnessCommitment:_$witnesscommitment_75,types:__types_61},ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={},z=0;z>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function prefixChk(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=polymodStep(t)^i>>5}for(t=polymodStep(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var n=(e=r).lastIndexOf("1");if(-1===n)return"No separator character for "+e;if(0===n)return"Missing prefix for "+e;var o=e.slice(0,n),a=e.slice(n+1);if(a.length<6)return"Data too short";var s=prefixChk(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(h)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function convert(e,t,r,i){for(var n=0,o=0,a=(1<=r;)o-=r,s.push(n>>o&a);if(i)o>0&&s.push(n<=t)return"Excess padding";if(n<r)throw new TypeError("Exceeds length limit");var i=prefixChk(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var n=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");i=polymodStep(i)^a,n+=ALPHABET.charAt(a)}for(o=0;o<6;++o)i=polymodStep(i);for(i^=1,o=0;o<6;++o){var s=i>>5*(5-o)&31;n+=ALPHABET.charAt(s)}return n},toWords:function(e){var t=convert(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWords:function(e){var t=convert(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},_$inherits_browser_388={};_$inherits_browser_388="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var _$events_350={},ReflectOwnKeys,R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var NumberIsNaN=Number.isNaN||function(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}_$events_350=EventEmitter,_$events_350.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,o),i(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&eventTargetAgnosticAddListener(e,"error",t,{once:!0})}(e,n)}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,r,i){var n,o,a,s;if(checkListener(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),(n=_getMaxListeners(e))>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function _onceWrap(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(i);return n.listener=r,i.wrapFn=n,n}function _listeners(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=n[e];if(void 0===s)return!1;if("function"==typeof s)ReflectApply(s,this,t);else{var c=s.length,u=arrayClone(s,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},EventEmitter.prototype.listeners=function(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};var _$streamBrowser_372=_$events_350.EventEmitter;function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _defineProperties(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return __Buffer_366.alloc(0);for(var t,r,i,n=__Buffer_366.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=n,i=a,__Buffer_366.prototype.copy.call(t,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0==(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=__Buffer_366.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t}},{key:custom,value:function(e,t){return inspect(this,function(e){for(var t=1;t1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,n,o,a;if("string"==typeof t&&("not ","not "===t.substr(0,"not ".length))?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=e,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(e," ").concat(i," ").concat(oneOf(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";n='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(oneOf(t,"type"))}return n+". Received type ".concat(typeof r)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_$errorsBrowser_359.codes=codes;var ERR_INVALID_OPT_VALUE=_$errorsBrowser_359.codes.ERR_INVALID_OPT_VALUE,_$state_371={getHighWaterMark:function(e,t,r,i){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new ERR_INVALID_OPT_VALUE(i?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}},_$browser_473={};(function(e){(function(){function t(t){try{if(!e.localStorage)return!1}catch(i){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}_$browser_473=function(e,r){if(t("noDeprecation"))return e;var i=!1;return function(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$safeBuffer_467={},__buffer_467=_$buffer_267({}),__Buffer_467=__buffer_467.Buffer;function __copyProps_467(e,t){for(var r in e)t[r]=e[r]}function __SafeBuffer_467(e,t,r){return __Buffer_467(e,t,r)}__Buffer_467.from&&__Buffer_467.alloc&&__Buffer_467.allocUnsafe&&__Buffer_467.allocUnsafeSlow?_$safeBuffer_467=__buffer_467:(__copyProps_467(__buffer_467,_$safeBuffer_467),_$safeBuffer_467.Buffer=__SafeBuffer_467),__copyProps_467(__Buffer_467,__SafeBuffer_467),__SafeBuffer_467.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return __Buffer_467(e,t,r)},__SafeBuffer_467.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=__Buffer_467(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},__SafeBuffer_467.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return __Buffer_467(e)},__SafeBuffer_467.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return __buffer_467.SlowBuffer(e)};var _$Transform_363=Transform,_require$codes=_$errorsBrowser_359.codes,ERR_METHOD_NOT_IMPLEMENTED=_require$codes.ERR_METHOD_NOT_IMPLEMENTED,ERR_MULTIPLE_CALLBACK=_require$codes.ERR_MULTIPLE_CALLBACK,ERR_TRANSFORM_ALREADY_TRANSFORMING=_require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,ERR_TRANSFORM_WITH_LENGTH_0=_require$codes.ERR_TRANSFORM_WITH_LENGTH_0,Duplex=_$Duplex_360({});function afterTransform(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new ERR_MULTIPLE_CALLBACK);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length0,(function(e){i||(i=e),e&&o.forEach(call),a||(o.forEach(call),n(i))}))}));return t.reduce(pipe)},_$readableBrowser_373={};_$readableBrowser_373=_$readableBrowser_373=_$_stream_readable_362({}),_$readableBrowser_373.Stream=_$readableBrowser_373,_$readableBrowser_373.Readable=_$readableBrowser_373,_$readableBrowser_373.Writable=_$_stream_writable_364({}),_$readableBrowser_373.Duplex=_$Duplex_360({}),_$readableBrowser_373.Transform=_$Transform_363,_$readableBrowser_373.PassThrough=_$PassThrough_361,_$readableBrowser_373.finished=_$eos_368({}),_$readableBrowser_373.pipeline=_$pipeline_370;var _$hashBase_358={},__Buffer_358=_$safeBuffer_424.Buffer,__Transform_358=_$readableBrowser_373.Transform;function HashBase(e){__Transform_358.call(this),this._block=__Buffer_358.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}_$inherits_browser_388(HashBase,__Transform_358),HashBase.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)},HashBase.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},HashBase.prototype.update=function(e,t){if(function(e,t){if(!__Buffer_358.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");__Buffer_358.isBuffer(e)||(e=__Buffer_358.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},HashBase.prototype._update=function(){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},_$hashBase_358=HashBase;var _$md5Js_391={},__Buffer_391=_$safeBuffer_424.Buffer,ARRAY16=new Array(16);function MD5(){_$hashBase_358.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(e,t){return e<>>32-t}function fnF(e,t,r,i,n,o,a){return rotl(e+(t&r|~t&i)+n+o|0,a)+t|0}function fnG(e,t,r,i,n,o,a){return rotl(e+(t&i|r&~i)+n+o|0,a)+t|0}function fnH(e,t,r,i,n,o,a){return rotl(e+(t^r^i)+n+o|0,a)+t|0}function fnI(e,t,r,i,n,o,a){return rotl(e+(r^(t|~i))+n+o|0,a)+t|0}_$inherits_browser_388(MD5,_$hashBase_358),MD5.prototype._update=function(){for(var e=ARRAY16,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;r=fnF(r,i,n,o,e[0],3614090360,7),o=fnF(o,r,i,n,e[1],3905402710,12),n=fnF(n,o,r,i,e[2],606105819,17),i=fnF(i,n,o,r,e[3],3250441966,22),r=fnF(r,i,n,o,e[4],4118548399,7),o=fnF(o,r,i,n,e[5],1200080426,12),n=fnF(n,o,r,i,e[6],2821735955,17),i=fnF(i,n,o,r,e[7],4249261313,22),r=fnF(r,i,n,o,e[8],1770035416,7),o=fnF(o,r,i,n,e[9],2336552879,12),n=fnF(n,o,r,i,e[10],4294925233,17),i=fnF(i,n,o,r,e[11],2304563134,22),r=fnF(r,i,n,o,e[12],1804603682,7),o=fnF(o,r,i,n,e[13],4254626195,12),n=fnF(n,o,r,i,e[14],2792965006,17),r=fnG(r,i=fnF(i,n,o,r,e[15],1236535329,22),n,o,e[1],4129170786,5),o=fnG(o,r,i,n,e[6],3225465664,9),n=fnG(n,o,r,i,e[11],643717713,14),i=fnG(i,n,o,r,e[0],3921069994,20),r=fnG(r,i,n,o,e[5],3593408605,5),o=fnG(o,r,i,n,e[10],38016083,9),n=fnG(n,o,r,i,e[15],3634488961,14),i=fnG(i,n,o,r,e[4],3889429448,20),r=fnG(r,i,n,o,e[9],568446438,5),o=fnG(o,r,i,n,e[14],3275163606,9),n=fnG(n,o,r,i,e[3],4107603335,14),i=fnG(i,n,o,r,e[8],1163531501,20),r=fnG(r,i,n,o,e[13],2850285829,5),o=fnG(o,r,i,n,e[2],4243563512,9),n=fnG(n,o,r,i,e[7],1735328473,14),r=fnH(r,i=fnG(i,n,o,r,e[12],2368359562,20),n,o,e[5],4294588738,4),o=fnH(o,r,i,n,e[8],2272392833,11),n=fnH(n,o,r,i,e[11],1839030562,16),i=fnH(i,n,o,r,e[14],4259657740,23),r=fnH(r,i,n,o,e[1],2763975236,4),o=fnH(o,r,i,n,e[4],1272893353,11),n=fnH(n,o,r,i,e[7],4139469664,16),i=fnH(i,n,o,r,e[10],3200236656,23),r=fnH(r,i,n,o,e[13],681279174,4),o=fnH(o,r,i,n,e[0],3936430074,11),n=fnH(n,o,r,i,e[3],3572445317,16),i=fnH(i,n,o,r,e[6],76029189,23),r=fnH(r,i,n,o,e[9],3654602809,4),o=fnH(o,r,i,n,e[12],3873151461,11),n=fnH(n,o,r,i,e[15],530742520,16),r=fnI(r,i=fnH(i,n,o,r,e[2],3299628645,23),n,o,e[0],4096336452,6),o=fnI(o,r,i,n,e[7],1126891415,10),n=fnI(n,o,r,i,e[14],2878612391,15),i=fnI(i,n,o,r,e[5],4237533241,21),r=fnI(r,i,n,o,e[12],1700485571,6),o=fnI(o,r,i,n,e[3],2399980690,10),n=fnI(n,o,r,i,e[10],4293915773,15),i=fnI(i,n,o,r,e[1],2240044497,21),r=fnI(r,i,n,o,e[8],1873313359,6),o=fnI(o,r,i,n,e[15],4264355552,10),n=fnI(n,o,r,i,e[6],2734768916,15),i=fnI(i,n,o,r,e[13],1309151649,21),r=fnI(r,i,n,o,e[4],4149444226,6),o=fnI(o,r,i,n,e[11],3174756917,10),n=fnI(n,o,r,i,e[2],718787259,15),i=fnI(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},MD5.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=__Buffer_391.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},_$md5Js_391=MD5;var _$ripemd160_423={},__Buffer_423=_$buffer_267({}).Buffer,__ARRAY16_423=new Array(16),zl=[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],zr=[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],sl=[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],sr=[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],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){_$hashBase_358.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function __rotl_423(e,t){return e<>>32-t}function fn1(e,t,r,i,n,o,a,s){return __rotl_423(e+(t^r^i)+o+a|0,s)+n|0}function fn2(e,t,r,i,n,o,a,s){return __rotl_423(e+(t&r|~t&i)+o+a|0,s)+n|0}function fn3(e,t,r,i,n,o,a,s){return __rotl_423(e+((t|~r)^i)+o+a|0,s)+n|0}function fn4(e,t,r,i,n,o,a,s){return __rotl_423(e+(t&i|r&~i)+o+a|0,s)+n|0}function fn5(e,t,r,i,n,o,a,s){return __rotl_423(e+(t^(r|~i))+o+a|0,s)+n|0}_$inherits_browser_388(RIPEMD160,_$hashBase_358),RIPEMD160.prototype._update=function(){for(var e=__ARRAY16_423,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,h=0|this._e,l=0;l<80;l+=1){var _,d;l<16?(_=fn1(r,i,n,o,a,e[zl[l]],hl[0],sl[l]),d=fn5(s,c,u,f,h,e[zr[l]],hr[0],sr[l])):l<32?(_=fn2(r,i,n,o,a,e[zl[l]],hl[1],sl[l]),d=fn4(s,c,u,f,h,e[zr[l]],hr[1],sr[l])):l<48?(_=fn3(r,i,n,o,a,e[zl[l]],hl[2],sl[l]),d=fn3(s,c,u,f,h,e[zr[l]],hr[2],sr[l])):l<64?(_=fn4(r,i,n,o,a,e[zl[l]],hl[3],sl[l]),d=fn2(s,c,u,f,h,e[zr[l]],hr[3],sr[l])):(_=fn5(r,i,n,o,a,e[zl[l]],hl[4],sl[l]),d=fn1(s,c,u,f,h,e[zr[l]],hr[4],sr[l])),r=a,a=o,o=__rotl_423(n,10),n=i,i=_,s=h,h=f,f=__rotl_423(u,10),u=c,c=d}var p=this._b+n+f|0;this._b=this._c+o+h|0,this._c=this._d+a+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=p},RIPEMD160.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=__Buffer_423.alloc?__Buffer_423.alloc(20):new __Buffer_423(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},_$ripemd160_423=RIPEMD160;var _$hash_437={},__Buffer_437=_$safeBuffer_424.Buffer;function Hash(e,t){this._block=__Buffer_437.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=__Buffer_437.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,a=0;a=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 i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},_$hash_437=Hash;var _$sha_439={},__Buffer_439=_$safeBuffer_424.Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,_$hash_437.call(this,64,56)}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}_$inherits_browser_388(Sha,_$hash_437),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var f=~~(u/20),h=0|((t=i)<<5|t>>>27)+ft(f,n,o,a)+s+r[u]+K[f];s=a,a=o,o=rotl30(n),n=i,i=h}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Sha.prototype._hash=function(){var e=__Buffer_439.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},_$sha_439=Sha;var _$sha1_440={},__Buffer_440=_$safeBuffer_424.Buffer,__K_440=[1518500249,1859775393,-1894007588,-899497514],__W_440=new Array(80);function Sha1(){this.init(),this._w=__W_440,_$hash_437.call(this,64,56)}function rotl5(e){return e<<5|e>>>27}function __rotl30_440(e){return e<<30|e>>>2}function __ft_440(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}_$inherits_browser_388(Sha1,_$hash_437),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var f=~~(u/20),h=rotl5(i)+__ft_440(f,n,o,a)+s+r[u]+__K_440[f]|0;s=a,a=o,o=__rotl30_440(n),n=i,i=h}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Sha1.prototype._hash=function(){var e=__Buffer_440.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},_$sha1_440=Sha1;var _$sha256_442={},__Buffer_442=_$safeBuffer_424.Buffer,__K_442=[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],__W_442=new Array(64);function Sha256(){this.init(),this._w=__W_442,_$hash_437.call(this,64,56)}function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}_$inherits_browser_388(Sha256,_$hash_437),Sha256.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},Sha256.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0|this._f,u=0|this._g,f=0|this._h,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<64;++h)r[h]=0|(((t=r[h-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[h-7]+gamma0(r[h-15])+r[h-16];for(var l=0;l<64;++l){var _=f+sigma1(s)+ch(s,c,u)+__K_442[l]+r[l]|0,d=sigma0(i)+maj(i,n,o)|0;f=u,u=c,c=s,s=a+_|0,a=o,o=n,n=i,i=_+d|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=u+this._g|0,this._h=f+this._h|0},Sha256.prototype._hash=function(){var e=__Buffer_442.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},_$sha256_442=Sha256;var _$sha224_441={},__Buffer_441=_$safeBuffer_424.Buffer,__W_441=new Array(64);function Sha224(){this.init(),this._w=__W_441,_$hash_437.call(this,64,56)}_$inherits_browser_388(Sha224,_$sha256_442),Sha224.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},Sha224.prototype._hash=function(){var e=__Buffer_441.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},_$sha224_441=Sha224;var _$sha512_444={},__Buffer_444=_$safeBuffer_424.Buffer,__K_444=[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],__W_444=new Array(160);function Sha512(){this.init(),this._w=__W_444,_$hash_437.call(this,128,112)}function Ch(e,t,r){return r^e&(t^r)}function __maj_444(e,t,r){return e&t|r&(e|t)}function __sigma0_444(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function __sigma1_444(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0>>0?1:0}_$inherits_browser_388(Sha512,_$hash_437),Sha512.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},Sha512.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,c=0|this._gh,u=0|this._hh,f=0|this._al,h=0|this._bl,l=0|this._cl,_=0|this._dl,d=0|this._el,p=0|this._fl,m=0|this._gl,b=0|this._hl,g=0;g<32;g+=2)t[g]=e.readInt32BE(4*g),t[g+1]=e.readInt32BE(4*g+4);for(;g<160;g+=2){var y=t[g-30],v=t[g-30+1],w=Gamma0(y,v),$=Gamma0l(v,y),E=Gamma1(y=t[g-4],v=t[g-4+1]),S=Gamma1l(v,y),A=t[g-14],B=t[g-14+1],k=t[g-32],M=t[g-32+1],T=$+B|0,R=w+A+getCarry(T,$)|0;R=(R=R+E+getCarry(T=T+S|0,S)|0)+k+getCarry(T=T+M|0,M)|0,t[g]=R,t[g+1]=T}for(var I=0;I<160;I+=2){R=t[I],T=t[I+1];var P=__maj_444(r,i,n),x=__maj_444(f,h,l),O=__sigma0_444(r,f),C=__sigma0_444(f,r),N=__sigma1_444(a,d),L=__sigma1_444(d,a),D=__K_444[I],U=__K_444[I+1],H=Ch(a,s,c),j=Ch(d,p,m),z=b+L|0,q=u+N+getCarry(z,b)|0;q=(q=(q=q+H+getCarry(z=z+j|0,j)|0)+D+getCarry(z=z+U|0,U)|0)+R+getCarry(z=z+T|0,T)|0;var K=C+x|0,F=O+P+getCarry(K,C)|0;u=c,b=m,c=s,m=p,s=a,p=d,a=o+q+getCarry(d=_+z|0,_)|0,o=n,_=l,n=i,l=h,i=r,h=f,r=q+F+getCarry(f=z+K|0,z)|0}this._al=this._al+f|0,this._bl=this._bl+h|0,this._cl=this._cl+l|0,this._dl=this._dl+_|0,this._el=this._el+d|0,this._fl=this._fl+p|0,this._gl=this._gl+m|0,this._hl=this._hl+b|0,this._ah=this._ah+r+getCarry(this._al,f)|0,this._bh=this._bh+i+getCarry(this._bl,h)|0,this._ch=this._ch+n+getCarry(this._cl,l)|0,this._dh=this._dh+o+getCarry(this._dl,_)|0,this._eh=this._eh+a+getCarry(this._el,d)|0,this._fh=this._fh+s+getCarry(this._fl,p)|0,this._gh=this._gh+c+getCarry(this._gl,m)|0,this._hh=this._hh+u+getCarry(this._hl,b)|0},Sha512.prototype._hash=function(){var e=__Buffer_444.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},_$sha512_444=Sha512;var _$sha384_443={},__Buffer_443=_$safeBuffer_424.Buffer,__W_443=new Array(160);function Sha384(){this.init(),this._w=__W_443,_$hash_437.call(this,128,112)}_$inherits_browser_388(Sha384,_$sha512_444),Sha384.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},Sha384.prototype._hash=function(){var e=__Buffer_443.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},_$sha384_443=Sha384;var _$shaJs_438={},exports=_$shaJs_438=function(e){e=e.toLowerCase();var t=exports[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};exports.sha=_$sha_439,exports.sha1=_$sha1_440,exports.sha224=_$sha224_441,exports.sha256=_$sha256_442,exports.sha384=_$sha384_443,exports.sha512=_$sha512_444;var _$streamBrowser_465=_$events_350.EventEmitter;function __ownKeys_459(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function ___defineProperty_459(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ___defineProperties_459(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return __Buffer_459.alloc(0);for(var t,r,i,n=__Buffer_459.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=n,i=a,__Buffer_459.prototype.copy.call(t,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0==(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=__Buffer_459.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t}},{key:__custom_459,value:function(e,t){return __inspect_459(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}__createErrorType_452("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),__createErrorType_452("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,n,o,a;if("string"==typeof t&&("not ","not "===t.substr(0,"not ".length))?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=e,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(e," ").concat(i," ").concat(__oneOf_452(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";n='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(__oneOf_452(t,"type"))}return n+". Received type ".concat(typeof r)}),TypeError),__createErrorType_452("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),__createErrorType_452("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),__createErrorType_452("ERR_STREAM_PREMATURE_CLOSE","Premature close"),__createErrorType_452("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),__createErrorType_452("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),__createErrorType_452("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),__createErrorType_452("ERR_STREAM_WRITE_AFTER_END","write after end"),__createErrorType_452("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),__createErrorType_452("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),__createErrorType_452("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_$errorsBrowser_452.codes=__codes_452;var __ERR_INVALID_OPT_VALUE_464=_$errorsBrowser_452.codes.ERR_INVALID_OPT_VALUE,_$state_464={getHighWaterMark:function(e,t,r,i){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new __ERR_INVALID_OPT_VALUE_464(i?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}},_$Transform_456=__Transform_456,___require$codes_456=_$errorsBrowser_452.codes,__ERR_METHOD_NOT_IMPLEMENTED_456=___require$codes_456.ERR_METHOD_NOT_IMPLEMENTED,__ERR_MULTIPLE_CALLBACK_456=___require$codes_456.ERR_MULTIPLE_CALLBACK,__ERR_TRANSFORM_ALREADY_TRANSFORMING_456=___require$codes_456.ERR_TRANSFORM_ALREADY_TRANSFORMING,__ERR_TRANSFORM_WITH_LENGTH_0_456=___require$codes_456.ERR_TRANSFORM_WITH_LENGTH_0,__Duplex_456=_$Duplex_453({});function __afterTransform_456(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new __ERR_MULTIPLE_CALLBACK_456);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length0,(function(e){i||(i=e),e&&o.forEach(__call_463),a||(o.forEach(__call_463),n(i))}))}));return t.reduce(__pipe_463)},_$Stream_451=Stream,EE=_$events_350.EventEmitter;function Stream(){EE.call(this)}_$inherits_browser_388(Stream,EE),Stream.Readable=_$_stream_readable_455({}),Stream.Writable=_$_stream_writable_457({}),Stream.Duplex=_$Duplex_453({}),Stream.Transform=_$Transform_456,Stream.PassThrough=_$PassThrough_454,Stream.finished=_$eos_461({}),Stream.pipeline=_$pipeline_463,Stream.Stream=Stream,Stream.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",n),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===EE.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};var _$cipherBase_274={},__Buffer_274=_$safeBuffer_424.Buffer,__Transform_274=_$Stream_451.Transform,__StringDecoder_274=_$string_decoder_466({}).StringDecoder;function CipherBase(e){__Transform_274.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}_$inherits_browser_388(CipherBase,__Transform_274),CipherBase.prototype.update=function(e,t,r){"string"==typeof e&&(e=__Buffer_274.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){i=n}finally{r(i)}},CipherBase.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},CipherBase.prototype._finalOrDigest=function(e){var t=this.__final()||__Buffer_274.alloc(0);return e&&(t=this._toString(t,e,!0)),t},CipherBase.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new __StringDecoder_274(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},_$cipherBase_274=CipherBase;var _$browser_276={};function __Hash_276(e){_$cipherBase_274.call(this,"digest"),this._hash=e}_$inherits_browser_388(__Hash_276,_$cipherBase_274),__Hash_276.prototype._update=function(e){this._hash.update(e)},__Hash_276.prototype._final=function(){return this._hash.digest()},_$browser_276=function(e){return"md5"===(e=e.toLowerCase())?new _$md5Js_391:"rmd160"===e||"ripemd160"===e?new _$ripemd160_423:new __Hash_276(_$shaJs_438(e))};var _Buffer=_$safeBuffer_424.Buffer,_$src_149=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,u=new Uint8Array(o);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,l=o-1;(0!==f||h>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");n=h,r++}if(" "!==e[r]){for(var _=o-n;_!==o&&0===u[_];)_++;var d=_Buffer.allocUnsafe(i+(o-_));d.fill(0,0,i);for(var p=i;_!==o;)d[p++]=u[_++];return d}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=_Buffer.from(t)),!_Buffer.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,n=0,o=t.length;n!==o&&0===t[n];)n++,r++;for(var c=(o-n)*u+1>>>0,f=new Uint8Array(c);n!==o;){for(var h=t[n],l=0,_=c-1;(0!==h||l>>0,f[_]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,n++}for(var d=c-i;d!==c&&0===f[d];)d++;for(var p=s.repeat(r);d21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function fromBech32(e){var t=_$bech32_187.decode(e),r=_$bech32_187.fromWords(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:__Buffer_47.from(r)}}function toBase58Check(e,t){_$typeforce_471(_$types_85.tuple(_$types_85.Hash160bit,_$types_85.UInt8),arguments);var r=__Buffer_47.allocUnsafe(21);return r.writeUInt8(t,0),e.copy(r,1),_$bs58check_263.encode(r)}function toBech32(e,t,r){var i=_$bech32_187.toWords(e);return i.unshift(t),_$bech32_187.encode(r,i)}var _$address_47={fromBase58Check:fromBase58Check,fromBech32:fromBech32,fromOutputScript:function(e,t){if(t=t||_$networks_56.bitcoin,_$templates_61.pubKeyHash.output.check(e))return toBase58Check(_$script_59.compile(e).slice(3,23),t.pubKeyHash);if(_$templates_61.scriptHash.output.check(e))return toBase58Check(_$script_59.compile(e).slice(2,22),t.scriptHash);if(_$templates_61.witnessPubKeyHash.output.check(e))return toBech32(_$script_59.compile(e).slice(2,22),0,t.bech32);if(_$templates_61.witnessScriptHash.output.check(e))return toBech32(_$script_59.compile(e).slice(2,34),0,t.bech32);throw new Error(_$script_59.toASM(e)+" has no matching Address")},toBase58Check:toBase58Check,toBech32:toBech32,toOutputScript:function(e,t){var r;t=t||_$networks_56.bitcoin;try{r=fromBase58Check(e)}catch(i){}if(r){if(r.version===t.pubKeyHash)return _$templates_61.pubKeyHash.output.encode(r.hash);if(r.version===t.scriptHash)return _$templates_61.scriptHash.output.encode(r.hash)}else{try{r=fromBech32(e)}catch(i){}if(r){if(r.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===r.version){if(20===r.data.length)return _$templates_61.witnessPubKeyHash.output.encode(r.data);if(32===r.data.length)return _$templates_61.witnessScriptHash.output.encode(r.data)}}}throw new Error(e+" has no matching Script")}};function ripemd160(e){return _$browser_276("rmd160").update(e).digest()}function sha256(e){return _$browser_276("sha256").update(e).digest()}var _$crypto_50={hash160:function(e){return ripemd160(sha256(e))},hash256:function(e){return sha256(sha256(e))},ripemd160:ripemd160,sha1:function(e){return _$browser_276("sha1").update(e).digest()},sha256:sha256},_$package_193={version:"1.4.2"},_$bigi_190={};function BigInteger(e,t,r){if(!(this instanceof BigInteger))return new BigInteger(e,t,r);null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}var proto=BigInteger.prototype;proto.__bigi=_$package_193.version,BigInteger.isBigInteger=function(e,t){return e&&e.__bigi&&(!t||e.__bigi===proto.__bigi)},BigInteger.prototype.am=function(e,t,r,i,n,o){for(;--o>=0;){var a=t*this[e++]+r[i]+n;n=Math.floor(a/67108864),r[i++]=67108863&a}return n},BigInteger.prototype.DB=26,BigInteger.prototype.DM=67108863;var DV=BigInteger.prototype.DV=1<<26;BigInteger.prototype.FV=Math.pow(2,52),BigInteger.prototype.F1=26,BigInteger.prototype.F2=0;var rr,vv,BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array;for(rr="0".charCodeAt(0),vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var r=BI_RC[e.charCodeAt(t)];return null==r?-1:r}function nbv(e){var t=new BigInteger;return t.fromInt(e),t}function nbits(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function Classic(e){this.m=e}function Montgomery(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function cbit(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function NullExp(){}function nNop(e){return e}function Barrett(e){this.r2=new BigInteger,this.q3=new BigInteger,BigInteger.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Classic.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Classic.prototype.revert=function(e){return e},Classic.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Classic.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Classic.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Montgomery.prototype.convert=function(e){var t=new BigInteger;return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(BigInteger.ZERO)>0&&this.m.subTo(t,t),t},Montgomery.prototype.revert=function(e){var t=new BigInteger;return e.copyTo(t),this.reduce(t),t},Montgomery.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,i,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Montgomery.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Montgomery.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},proto.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},proto.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0},proto.fromString=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.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var i=e.length,n=!1,o=0;--i>=0;){var a=8==r?255&e[i]:intAt(e,i);a<0?"-"==e.charAt(i)&&(n=!0):(n=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},proto.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},proto.drShiftTo=function(e,t){for(var r=e;r=0;--r)t[r+a+1]=this[r]>>n|s,s=(this[r]&o)<=0;--r)t[r]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},proto.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,o=(1<>i;for(var a=r+1;a>i;i>0&&(t[this.t-r-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[r++]=this.DV+i:i>0&&(t[r++]=i),t.t=r,t.clamp()},proto.multiplyTo=function(e,t){var r=this.abs(),i=e.abs(),n=r.t;for(t.t=n+i.t;--n>=0;)t[n]=0;for(n=0;n=0;)e[r]=0;for(r=0;r=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},proto.divRemTo=function(e,t,r){var i=e.abs();if(!(i.t<=0)){var n=this.abs();if(n.t0?(i.lShiftTo(c,o),n.lShiftTo(c,r)):(i.copyTo(o),n.copyTo(r));var u=o.t,f=o[u-1];if(0!=f){var h=f*(1<1?o[u-2]>>this.F2:0),l=this.FV/h,_=(1<=0&&(r[r.t++]=1,r.subTo(b,r)),BigInteger.ONE.dlShiftTo(u,b),b.subTo(o,o);o.t=0;){var g=r[--p]==f?this.DM:Math.floor(r[p]*l+(r[p-1]+d)*_);if((r[p]+=o.am(0,g,r,m,0,u))0&&r.rShiftTo(c,r),a<0&&BigInteger.ZERO.subTo(r,r)}}},proto.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},proto.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},proto.exp=function(e,t){if(e>4294967295||e<1)return BigInteger.ONE;var r=new BigInteger,i=new BigInteger,n=t.convert(this),o=nbits(e)-1;for(n.copyTo(r);--o>=0;)if(t.sqrTo(r,i),(e&1<0)t.mulTo(i,n,r);else{var a=r;r=i,i=a}return t.revert(r)},proto.toString=function(e){var t;if(this.s<0)return"-"+this.negate().toString(e);if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,i=(1<0)for(s>s)>0&&(n=!0,o=int2char(r));a>=0;)s>(s+=this.DB-t)):(r=this[a]>>(s-=t)&i,s<=0&&(s+=this.DB,--a)),r>0&&(n=!0),n&&(o+=int2char(r));return n?o:"0"},proto.negate=function(){var e=new BigInteger;return BigInteger.ZERO.subTo(this,e),e},proto.abs=function(){return this.s<0?this.negate():this},proto.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},proto.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)},proto.byteLength=function(){return this.bitLength()>>3},proto.mod=function(e){var t=new BigInteger;return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&e.subTo(t,t),t},proto.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new Classic(t):new Montgomery(t),this.exp(e,r)},NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},NullExp.prototype.sqrTo=function(e,t){e.squareTo(t)},Barrett.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=new BigInteger;return e.copyTo(t),this.reduce(t),t},Barrett.prototype.revert=function(e){return e},Barrett.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},Barrett.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Barrett.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];proto.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},proto.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),i=nbv(r),n=new BigInteger,o=new BigInteger,a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(e)+a},proto.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),n=!1,o=0,a=0,s=0;s=r&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),n&&BigInteger.ZERO.subTo(this,this)},proto.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(e-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(BigInteger.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),n>0?i[0]&=(1<>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[r++]=i:i<-1&&(t[r++]=this.DV+i),t.t=r,t.clamp()},proto.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},proto.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},proto.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(i=r.t-this.t;n=0;)r[i]=0;for(i=Math.max(t-this.t,0);i0)if(0==t)r=this[0]%e;else for(var i=this.t-1;i>=0;--i)r=(t*r+this[i])%e;return r},proto.millerRabin=function(e){var t=this.subtract(BigInteger.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var i=t.shiftRight(r);(e=e+1>>1)>lowprimes.length&&(e=lowprimes.length);for(var n=new BigInteger(null),o=[],a=0;a>24},proto.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},proto.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},proto.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,i=this.DB-e*this.DB%8,n=0;if(e-- >0)for(i>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<=0;)i<8?(r=(this[e]&(1<>(i+=this.DB-8)):(r=this[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),0!=(128&r)&&(r|=-256),0===n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t},proto.equals=function(e){return 0==this.compareTo(e)},proto.min=function(e){return this.compareTo(e)<0?this:e},proto.max=function(e){return this.compareTo(e)>0?this:e},proto.and=function(e){var t=new BigInteger;return this.bitwiseTo(e,op_and,t),t},proto.or=function(e){var t=new BigInteger;return this.bitwiseTo(e,op_or,t),t},proto.xor=function(e){var t=new BigInteger;return this.bitwiseTo(e,op_xor,t),t},proto.andNot=function(e){var t=new BigInteger;return this.bitwiseTo(e,op_andnot,t),t},proto.not=function(){for(var e=new BigInteger,t=0;t=this.t?0!=this.s:0!=(this[t]&1<1){var f=new BigInteger;for(i.sqrTo(a[1],f);s<=u;)a[s]=new BigInteger,i.mulTo(f,a[s-2],a[s]),s+=2}var h,l,_=e.t-1,d=!0,p=new BigInteger;for(n=nbits(e[_])-1;_>=0;){for(n>=c?h=e[_]>>n-c&u:(h=(e[_]&(1<0&&(h|=e[_-1]>>this.DB+n-c)),s=r;0==(1&h);)h>>=1,--s;if((n-=s)<0&&(n+=this.DB,--_),d)a[h].copyTo(o),d=!1;else{for(;s>1;)i.sqrTo(o,p),i.sqrTo(p,o),s-=2;s>0?i.sqrTo(o,p):(l=o,o=p,p=l),i.mulTo(p,a[h],o)}for(;_>=0&&0==(e[_]&1<=0?(r.subTo(i,r),t&&n.subTo(a,n),o.subTo(s,o)):(i.subTo(r,i),t&&a.subTo(n,a),s.subTo(o,s))}if(0!=i.compareTo(BigInteger.ONE))return BigInteger.ZERO;for(;s.compareTo(e)>=0;)s.subTo(e,s);for(;s.signum()<0;)s.addTo(e,s);return s},proto.pow=function(e){return this.exp(e,new NullExp)},proto.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var i=t;t=r,r=i}var n=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(n0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},proto.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=lowprimes[lowprimes.length-1]){for(t=0;t=4)throw new Error("Invalid hashType "+r);return{signature:t.fromDER(e.slice(0,-1)),hashType:r}},t.prototype.toCompact=function(t,r){r&&(t+=4),t+=27;var i=e.alloc(65);return i.writeUInt8(t,0),this.toRSBuffer(i,1),i},t.prototype.toDER=function(){var t=e.from(this.r.toDERInteger()),r=e.from(this.s.toDERInteger());return _$bip66_212.encode(t,r)},t.prototype.toRSBuffer=function(t,r){return r||(r=0),t=t||e.alloc(64),this.r.toBuffer(32).copy(t,r),this.s.toBuffer(32).copy(t,r+32),t},t.prototype.toScriptSignature=function(r,i){i||(i=t.ECDSA);var n=-193&r;if(n<=0||n>=4)throw new Error("Invalid hashType "+r);var o=e.alloc(1);if(o.writeUInt8(r,0),i===t.ECDSA)return e.concat([this.toDER(),o]);if(i===t.SCHNORR)return e.concat([this.toRSBuffer(),o]);throw new Error("Invalid signature Algorithm")},_$ecsignature_53=t}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$point_333={},__Buffer_333=_$safeBuffer_424.Buffer,THREE=_$lib_192.valueOf(3);function Point(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=i,this._zInv=null,this.compressed=!0}Object.defineProperty(Point.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point.fromAffine=function(e,t,r){return new Point(e,t,r,_$lib_192.ONE)},Point.prototype.equals=function(e){return e===this||(this.curve.isInfinity(this)?this.curve.isInfinity(e):this.curve.isInfinity(e)?this.curve.isInfinity(this):0===e.y.multiply(this.z).subtract(this.y.multiply(e.z)).mod(this.curve.p).signum()&&0===e.x.multiply(this.z).subtract(this.x.multiply(e.z)).mod(this.curve.p).signum())},Point.prototype.negate=function(){var e=this.curve.p.subtract(this.y);return new Point(this.curve,this.x,e,this.z)},Point.prototype.add=function(e){if(this.curve.isInfinity(this))return e;if(this.curve.isInfinity(e))return this;var t=this.x,r=this.y,i=e.x,n=e.y.multiply(this.z).subtract(r.multiply(e.z)).mod(this.curve.p),o=i.multiply(this.z).subtract(t.multiply(e.z)).mod(this.curve.p);if(0===o.signum())return 0===n.signum()?this.twice():this.curve.infinity;var a=o.square(),s=a.multiply(o),c=t.multiply(a),u=n.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(o).mod(this.curve.p),h=c.multiply(THREE).multiply(n).subtract(r.multiply(s)).subtract(u.multiply(n)).multiply(e.z).add(n.multiply(s)).mod(this.curve.p),l=s.multiply(this.z).multiply(e.z).mod(this.curve.p);return new Point(this.curve,f,h,l)},Point.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var e=this.x,t=this.y,r=t.multiply(this.z).mod(this.curve.p),i=r.multiply(t).mod(this.curve.p),n=this.curve.a,o=e.square().multiply(THREE);0!==n.signum()&&(o=o.add(this.z.square().multiply(n)));var a=(o=o.mod(this.curve.p)).square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.p),s=o.multiply(THREE).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(o.pow(3)).mod(this.curve.p),c=r.pow(3).shiftLeft(3).mod(this.curve.p);return new Point(this.curve,a,s,c)},Point.prototype.multiply=function(e){if(this.curve.isInfinity(this))return this;if(0===e.signum())return this.curve.infinity;for(var t=e,r=t.multiply(THREE),i=this.negate(),n=this,o=r.bitLength()-2;o>0;--o){var a=r.testBit(o),s=t.testBit(o);n=n.twice(),a!==s&&(n=n.add(a?this:i))}return n},Point.prototype.multiplyTwo=function(e,t,r){for(var i=Math.max(e.bitLength(),r.bitLength())-1,n=this.curve.infinity,o=this.add(t);i>=0;){var a=e.testBit(i),s=r.testBit(i);n=n.twice(),a?n=s?n.add(o):n.add(this):s&&(n=n.add(t)),--i}return n},Point.prototype.getEncoded=function(e){if(null==e&&(e=this.compressed),this.curve.isInfinity(this))return __Buffer_333.alloc(1,0);var t,r=this.affineX,i=this.affineY,n=this.curve.pLength;return e?(t=__Buffer_333.allocUnsafe(1+n)).writeUInt8(i.isEven()?2:3,0):((t=__Buffer_333.allocUnsafe(1+n+n)).writeUInt8(4,0),i.toBuffer(n).copy(t,1+n)),r.toBuffer(n).copy(t,1),t},Point.decodeFrom=function(e,t){var r,i=t.readUInt8(0),n=4!==i,o=Math.floor((e.p.bitLength()+7)/8),a=_$lib_192.fromBuffer(t.slice(1,1+o));if(n){var s=3===i;r=e.pointFromX(s,a)}else{var c=_$lib_192.fromBuffer(t.slice(1+o));r=Point.fromAffine(e,a,c)}return r.compressed=n,r},Point.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},_$point_333=Point;var _$curve_329={};function Curve(e,t,r,i,n,o,a){this.p=e,this.a=t,this.b=r,this.G=_$point_333.fromAffine(this,i,n),this.n=o,this.h=a,this.infinity=new _$point_333(this,null,null,_$lib_192.ZERO),this.pOverFour=e.add(_$lib_192.ONE).shiftRight(2),this.pLength=Math.floor((this.p.bitLength()+7)/8)}Curve.prototype.pointFromX=function(e,t){var r=t.pow(3).add(this.a.multiply(t)).add(this.b).mod(this.p).modPow(this.pOverFour,this.p),i=r;return r.isEven()^!e&&(i=this.p.subtract(i)),_$point_333.fromAffine(this,t,i)},Curve.prototype.isInfinity=function(e){return e===this.infinity||0===e.z.signum()&&0!==e.y.signum()},Curve.prototype.isOnCurve=function(e){if(this.isInfinity(e))return!0;var t=e.affineX,r=e.affineY,i=this.a,n=this.b,o=this.p;if(t.signum()<0||t.compareTo(o)>=0)return!1;if(r.signum()<0||r.compareTo(o)>=0)return!1;var a=r.square().mod(o),s=t.pow(3).add(i.multiply(t)).add(n).mod(o);return a.equals(s)},Curve.prototype.validate=function(e){return e.multiply(this.n),!0},_$curve_329=Curve;var _$curves_330={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}},_$names_332=function(e){var t=_$curves_330[e];if(!t)return null;var r=new _$lib_192(t.p,16),i=new _$lib_192(t.a,16),n=new _$lib_192(t.b,16),o=new _$lib_192(t.n,16),a=new _$lib_192(t.h,16),s=new _$lib_192(t.Gx,16),c=new _$lib_192(t.Gy,16);return new _$curve_329(r,i,n,s,c,o,a)},_$lib_331={Point:_$point_333,getCurveByName:_$names_332},_$legacy_279={},__Buffer_279=_$safeBuffer_424.Buffer,ZEROS=__Buffer_279.alloc(128),blocksize=64;function Hmac(e,t){_$cipherBase_274.call(this,"digest"),"string"==typeof t&&(t=__Buffer_279.from(t)),this._alg=e,this._key=t,t.length>blocksize?t=e(t):t.lengthr?t=("rmd160"===e?new _$ripemd160_423:_$shaJs_438(e)).update(t).digest():t.length=0||!r(a);)n=_$browser_278("sha256",n).update(o).update(ZERO).digest(),o=_$browser_278("sha256",n).update(o).digest(),o=_$browser_278("sha256",n).update(o).digest(),a=_$lib_192.fromBuffer(o);return a}},__secp256k1_51=_$lib_331.getCurveByName("secp256k1"),deterministicGenerateK=_$rfc6979_57.deterministicGenerateK,N_OVER_TWO=__secp256k1_51.n.shiftRight(1),_$ecdsa_51={sign:function(e,t){_$typeforce_471(_$types_85.tuple(_$types_85.Hash256bit,_$types_85.BigInt),arguments);var r,i,n=t.toBuffer(32),o=_$lib_192.fromBuffer(e),a=__secp256k1_51.n,s=__secp256k1_51.G;return deterministicGenerateK(e,n,(function(e){var n=s.multiply(e);return!__secp256k1_51.isInfinity(n)&&0!==(r=n.affineX.mod(a)).signum()&&0!==(i=e.modInverse(a).multiply(o.add(t.multiply(r))).mod(a)).signum()})),i.compareTo(N_OVER_TWO)>0&&(i=a.subtract(i)),new _$ecsignature_53(r,i)},verify:function(e,t,r){_$typeforce_471(_$types_85.tuple(_$types_85.Hash256bit,_$types_85.ECSignature,_$types_85.ECPoint),arguments);var i=__secp256k1_51.n,n=__secp256k1_51.G,o=t.r,a=t.s;if(o.signum()<=0||o.compareTo(i)>=0)return!1;if(a.signum()<=0||a.compareTo(i)>=0)return!1;var s=_$lib_192.fromBuffer(e),c=a.modInverse(i),u=s.multiply(c).mod(i),f=o.multiply(c).mod(i),h=n.multiplyTwo(u,r,f);return!__secp256k1_51.isInfinity(h)&&h.affineX.mod(i).equals(o)},__curve:__secp256k1_51},_$schnorr_58={};(function(e){(function(){var t=_$lib_331.getCurveByName("secp256k1"),r=_$rfc6979_57.deterministicGenerateK;function i(e,t){return e.modPow(t.subtract(_$lib_192.ONE).divide(_$lib_192.valueOf(2)),t).intValue()}function n(t){return _$typeforce_471(_$types_85.tuple(_$types_85.ECPoint),arguments),e.concat([e.from([t.affineY.isEven()?2:3]),t.affineX.toBuffer(32)])}_$schnorr_58={sign:function(o,a){_$typeforce_471(_$types_85.tuple(_$types_85.BufferN(32),_$types_85.BigInt),arguments);var s=t.n,c=t.G;if(a.compareTo(_$lib_192.ZERO)<=0||a.compareTo(s)>=0)throw new Error("Private key x not in range");var u,f,h=c.multiply(a);function l(r){var l=c.multiply(r);1!=i(l.affineY,t.p)&&(r=s.subtract(r),l=c.multiply(r)),u=l.affineX.mod(s);var _=n(h),d=u.toBuffer(32),p=_$crypto_50.sha256(e.concat([d,_,o])),m=_$lib_192.fromBuffer(p).mod(s);return f=r.add(m.multiply(a)).mod(s),!0}return r(o,a.toBuffer(32),l,e.from("Schnorr+SHA256 ","ascii")),new _$ecsignature_53(u,f)}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$browser_421={};(function(e,t){(function(){"use strict";var r=_$safeBuffer_424.Buffer,i=t.crypto||t.msCrypto;_$browser_421=i&&i.getRandomValues?function(t,n){if(t>4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a=0)throw new Error("Private key must be less than the curve order");if(t)throw new TypeError("Unexpected publicKey parameter");this.d=e}else _$typeforce_471(_$types_85.ECPoint,t),this.__Q=t;this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||_$networks_56.bitcoin}Object.defineProperty(ECPair.prototype,"Q",{get:function(){return!this.__Q&&this.d&&(this.__Q=__secp256k1_52.G.multiply(this.d)),this.__Q}}),ECPair.fromPublicKeyBuffer=function(e,t){var r=_$lib_331.Point.decodeFrom(__secp256k1_52,e);return new ECPair(null,r,{compressed:r.compressed,network:t})},ECPair.fromWIF=function(e,t){var r=_$wif_475.decode(e),i=r.version;if(_$types_85.Array(t)){if(!(t=t.filter((function(e){return i===e.wif})).pop()))throw new Error("Unknown network version")}else if(t=t||_$networks_56.bitcoin,i!==t.wif)throw new Error("Invalid network version");return new ECPair(_$lib_192.fromBuffer(r.privateKey),null,{compressed:r.compressed,network:t})},ECPair.makeRandom=function(e){var t,r=(e=e||{}).rng||_$browser_421;do{var i=r(32);_$typeforce_471(_$types_85.Buffer256bit,i),t=_$lib_192.fromBuffer(i)}while(t.signum()<=0||t.compareTo(__secp256k1_52.n)>=0);return new ECPair(t,null,e)},ECPair.prototype.getAddress=function(){return _$address_47.toBase58Check(_$crypto_50.hash160(this.getPublicKeyBuffer()),this.getNetwork().pubKeyHash)},ECPair.prototype.getNetwork=function(){return this.network},ECPair.prototype.getPublicKeyBuffer=function(){return this.Q.getEncoded(this.compressed)},ECPair.prototype.sign=function(e,t){if(!this.d)throw new Error("Missing private key");return t||(t=_$ecsignature_53.ECDSA),t===_$ecsignature_53.ECDSA?_$ecdsa_51.sign(e,this.d):t===_$ecsignature_53.SCHNORR?_$schnorr_58.sign(e,this.d):void 0},ECPair.prototype.toWIF=function(){if(!this.d)throw new Error("Missing private key");return _$wif_475.encode(this.network.wif,this.d.toBuffer(32),this.compressed)},ECPair.prototype.verify=function(e,t){return _$ecdsa_51.verify(e,t,this.Q)},_$ecpair_52=ECPair;var _$hdnode_54={},__Buffer_54=_$safeBuffer_424.Buffer,curve=_$lib_331.getCurveByName("secp256k1");function HDNode(e,t){if(!e.compressed)throw new TypeError("BIP32 only allows compressed keyPairs");this.keyPair=e,this.chainCode=t,this.depth=0,this.index=0,this.parentFingerprint=0}HDNode.HIGHEST_BIT=2147483648,HDNode.LENGTH=78,HDNode.MASTER_SECRET=__Buffer_54.from("Bitcoin seed","utf8"),HDNode.fromSeedBuffer=function(e,t){if(_$typeforce_471(_$types_85.tuple(_$types_85.Buffer,_$types_85.maybe(_$types_85.Network)),arguments),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");var r=_$browser_278("sha512",HDNode.MASTER_SECRET).update(e).digest(),i=r.slice(0,32),n=r.slice(32),o=_$lib_192.fromBuffer(i);return new HDNode(new _$ecpair_52(o,null,{network:t}),n)},HDNode.fromSeedHex=function(e,t){return HDNode.fromSeedBuffer(__Buffer_54.from(e,"hex"),t)},HDNode.fromBase58=function(e,t){var r=_$bs58check_263.decode(e);if(78!==r.length)throw new Error("Invalid buffer length");var i,n=r.readUInt32BE(0);if(Array.isArray(t)){if(!(i=t.filter((function(e){return n===e.bip32.private||n===e.bip32.public})).pop()))throw new Error("Unknown network version")}else i=t||_$networks_56.bitcoin;if(n!==i.bip32.private&&n!==i.bip32.public)throw new Error("Invalid network version");var o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new Error("Invalid parent fingerprint");var s=r.readUInt32BE(9);if(0===o&&0!==s)throw new Error("Invalid index");var c,u=r.slice(13,45);if(n===i.bip32.private){if(0!==r.readUInt8(45))throw new Error("Invalid private key");var f=_$lib_192.fromBuffer(r.slice(46,78));c=new _$ecpair_52(f,null,{network:i})}else{var h=_$lib_331.Point.decodeFrom(curve,r.slice(45,78));curve.validate(h),c=new _$ecpair_52(null,h,{network:i})}var l=new HDNode(c,u);return l.depth=o,l.index=s,l.parentFingerprint=a,l},HDNode.prototype.getAddress=function(){return this.keyPair.getAddress()},HDNode.prototype.getIdentifier=function(){return _$crypto_50.hash160(this.keyPair.getPublicKeyBuffer())},HDNode.prototype.getFingerprint=function(){return this.getIdentifier().slice(0,4)},HDNode.prototype.getNetwork=function(){return this.keyPair.getNetwork()},HDNode.prototype.getPublicKeyBuffer=function(){return this.keyPair.getPublicKeyBuffer()},HDNode.prototype.neutered=function(){var e=new HDNode(new _$ecpair_52(null,this.keyPair.Q,{network:this.keyPair.network}),this.chainCode);return e.depth=this.depth,e.index=this.index,e.parentFingerprint=this.parentFingerprint,e},HDNode.prototype.sign=function(e){return this.keyPair.sign(e)},HDNode.prototype.verify=function(e,t){return this.keyPair.verify(e,t)},HDNode.prototype.toBase58=function(e){if(void 0!==e)throw new TypeError("Unsupported argument in 2.0.0");var t=this.keyPair.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,i=__Buffer_54.allocUnsafe(78);return i.writeUInt32BE(r,0),i.writeUInt8(this.depth,4),i.writeUInt32BE(this.parentFingerprint,5),i.writeUInt32BE(this.index,9),this.chainCode.copy(i,13),this.isNeutered()?this.keyPair.getPublicKeyBuffer().copy(i,45):(i.writeUInt8(0,45),this.keyPair.d.toBuffer(32).copy(i,46)),_$bs58check_263.encode(i)},HDNode.prototype.derive=function(e){_$typeforce_471(_$types_85.UInt32,e);var t=e>=HDNode.HIGHEST_BIT,r=__Buffer_54.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Could not derive hardened child key");r[0]=0,this.keyPair.d.toBuffer(32).copy(r,1),r.writeUInt32BE(e,33)}else this.keyPair.getPublicKeyBuffer().copy(r,0),r.writeUInt32BE(e,33);var i,n=_$browser_278("sha512",this.chainCode).update(r).digest(),o=n.slice(0,32),a=n.slice(32),s=_$lib_192.fromBuffer(o);if(s.compareTo(curve.n)>=0)return this.derive(e+1);if(this.isNeutered()){var c=curve.G.multiply(s).add(this.keyPair.Q);if(curve.isInfinity(c))return this.derive(e+1);i=new _$ecpair_52(null,c,{network:this.keyPair.network})}else{var u=s.add(this.keyPair.d).mod(curve.n);if(0===u.signum())return this.derive(e+1);i=new _$ecpair_52(u,null,{network:this.keyPair.network})}var f=new HDNode(i,a);return f.depth=this.depth+1,f.index=e,f.parentFingerprint=this.getFingerprint().readUInt32BE(0),f},HDNode.prototype.deriveHardened=function(e){return _$typeforce_471(_$types_85.UInt31,e),this.derive(e+HDNode.HIGHEST_BIT)},HDNode.prototype.isNeutered=function(){return!this.keyPair.d},HDNode.prototype.derivePath=function(e){_$typeforce_471(_$types_85.BIP32Path,e);var t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new Error("Not a master node");t=t.slice(1)}return t.reduce((function(e,t){var r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))}),this)},_$hdnode_54=HDNode;var __Buffer_474=_$safeBuffer_424.Buffer,MAX_SAFE_INTEGER=9007199254740991;function checkUInt53(e){if(e<0||e>MAX_SAFE_INTEGER||e%1!=0)throw new RangeError("value out of range")}function __encodingLength_474(e){return checkUInt53(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var _$varuintBitcoin_474={encode:function e(t,r,i){if(checkUInt53(t),r||(r=__Buffer_474.allocUnsafe(__encodingLength_474(t))),!__Buffer_474.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t<253?(r.writeUInt8(t,i),e.bytes=1):t<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(t,i+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(t,i+1),e.bytes=5):(r.writeUInt8(255,i),r.writeUInt32LE(t>>>0,i+1),r.writeUInt32LE(t/4294967296|0,i+5),e.bytes=9),r},decode:function e(t,r){if(!__Buffer_474.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return e.bytes=1,i;if(253===i)return e.bytes=3,t.readUInt16LE(r+1);if(254===i)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var n=t.readUInt32LE(r+1),o=4294967296*t.readUInt32LE(r+5)+n;return checkUInt53(o),o},encodingLength:__encodingLength_474};function verifuint(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}var _$bufferutils_49={pushDataSize:_$pushdataBitcoin_104.encodingLength,readPushDataInt:_$pushdataBitcoin_104.decode,readUInt64LE:function(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return verifuint((i*=4294967296)+r,9007199254740991),i+r},readVarInt:function(e,t){return{number:_$varuintBitcoin_474.decode(e,t),size:_$varuintBitcoin_474.decode.bytes}},varIntBuffer:_$varuintBitcoin_474.encode,varIntSize:_$varuintBitcoin_474.encodingLength,writePushDataInt:_$pushdataBitcoin_104.encode,writeUInt64LE:function(e,t,r){return verifuint(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8},writeVarInt:function(e,t,r){return _$varuintBitcoin_474.encode(t,e,r),_$varuintBitcoin_474.encode.bytes}},_$transaction_83={},__Buffer_83=_$safeBuffer_424.Buffer;function varSliceSize(e){var t=e.length;return _$varuintBitcoin_474.encodingLength(t)+t}function Transaction(){this.version=2,this.locktime=0,this.ins=[],this.outs=[]}Transaction.DEFAULT_SEQUENCE=4294967295,Transaction.SIGHASH_ALL=1,Transaction.SIGHASH_NONE=2,Transaction.SIGHASH_SINGLE=3,Transaction.SIGHASH_ANYONECANPAY=128,Transaction.SIGHASH_BITCOINCASHBIP143=64,Transaction.ADVANCED_TRANSACTION_MARKER=0,Transaction.ADVANCED_TRANSACTION_FLAG=1;var EMPTY_SCRIPT=__Buffer_83.allocUnsafe(0),EMPTY_WITNESS=[],__ZERO_83=__Buffer_83.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),__ONE_83=__Buffer_83.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),VALUE_UINT64_MAX=__Buffer_83.from("ffffffffffffffff","hex"),BLANK_OUTPUT={script:EMPTY_SCRIPT,valueBuffer:VALUE_UINT64_MAX};Transaction.fromBuffer=function(e,t){var r=0;function i(t){return r+=t,e.slice(r-t,r)}function n(){var t=e.readUInt32LE(r);return r+=4,t}function o(){var t=_$bufferutils_49.readUInt64LE(e,r);return r+=8,t}function a(){var t=_$varuintBitcoin_474.decode(e,r);return r+=_$varuintBitcoin_474.decode.bytes,t}function s(){return i(a())}function c(){for(var e=a(),t=[],r=0;r=this.ins.length)return __ONE_83;var i=_$script_59.compile(_$script_59.decompile(t).filter((function(e){return e!==_$index_45.OP_CODESEPARATOR}))),n=this.clone();if((31&r)===Transaction.SIGHASH_NONE)n.outs=[],n.ins.forEach((function(t,r){r!==e&&(t.sequence=0)}));else if((31&r)===Transaction.SIGHASH_SINGLE){if(e>=this.outs.length)return __ONE_83;n.outs.length=e+1;for(var o=0;o0)return t=t.map((function(e){return e||_$index_45.OP_0})),i||(t=t.filter((function(e){return e!==_$index_45.OP_0}))),_$templates_61.multisig.input.encodeStack(t)}if(!i)throw new Error("Not enough signatures provided");return[]}function TransactionBuilder(e,t){this.prevTxMap={},this.network=e||_$networks_56.bitcoin,this.maximumFeeRate=t||2500,this.inputs=[],this.bitcoinCash=!0,this.tx=new _$transaction_83}function canSign(e){return void 0!==e.prevOutScript&&void 0!==e.signScript&&void 0!==e.pubKeys&&void 0!==e.signatures&&e.signatures.length===e.pubKeys.length&&e.pubKeys.length>0&&(!1===e.witness||!0===e.witness&&void 0!==e.value)}function signatureHashType(e){return e.readUInt8(e.length-1)}TransactionBuilder.prototype.setLockTime=function(e){if(_$typeforce_471(_$types_85.UInt32,e),this.inputs.some((function(e){return!!e.signatures&&e.signatures.some((function(e){return e}))})))throw new Error("No, this would invalidate signatures");this.tx.locktime=e},TransactionBuilder.fromTransaction=function(e,t,r){var i=new TransactionBuilder(t);return i.setLockTime(e.locktime),e.outs.forEach((function(e){i.addOutput(e.script,e.value)})),e.ins.forEach((function(e){i.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness,value:e.value})})),i.inputs.forEach((function(t,i){!function(e,t,r,i,n){if(e.redeemScriptType===scriptTypes.MULTISIG&&e.redeemScript&&e.pubKeys.length!==e.signatures.length){var o=e.signatures.concat();e.signatures=e.pubKeys.map((function(a){var s,c=_$ecpair_52.fromPublicKeyBuffer(a);return o.some((function(a,u){if(!a)return!1;var f,h=_$ecsignature_53.parseScriptSignature(a);return f=n?t.hashForCashSignature(r,e.signScript,i,h.hashType):e.witness?t.hashForWitnessV0(r,e.signScript,i,h.hashType):t.hashForSignature(r,e.signScript,h.hashType),!!c.verify(f,h.signature)&&(o[u]=void 0,s=a,!0)})),s}))}}(t,e,i,t.value,r)})),i},TransactionBuilder.prototype.addInput=function(e,t,r,i){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var n;if("string"==typeof e)e=__Buffer_84.from(e,"hex").reverse();else if(e instanceof _$transaction_83){var o=e.outs[t];i=o.script,n=o.value,e=e.getHash()}return this.__addInputUnsafe(e,t,{sequence:r,prevOutScript:i,value:n})},TransactionBuilder.prototype.__addInputUnsafe=function(e,t,r){if(_$transaction_83.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");var i=e.toString("hex")+":"+t;if(void 0!==this.prevTxMap[i])throw new Error("Duplicate TxOut: "+i);var n={};if(void 0!==r.script&&(n=expandInput(r.script,r.witness||[])),void 0!==r.value&&(n.value=r.value),!n.prevOutScript&&r.prevOutScript){var o;if(!n.pubKeys&&!n.signatures){var a=expandOutput(r.prevOutScript);a.pubKeys&&(n.pubKeys=a.pubKeys,n.signatures=a.signatures),o=a.scriptType}n.prevOutScript=r.prevOutScript,n.prevOutType=o||_$templates_61.classifyOutput(r.prevOutScript)}var s=this.tx.addInput(e,t,r.sequence,r.scriptSig);return this.inputs[s]=n,this.prevTxMap[i]=s,s},TransactionBuilder.prototype.addOutput=function(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=_$address_47.toOutputScript(e,this.network)),this.tx.addOutput(e,t)},TransactionBuilder.prototype.build=function(){return this.__build(!1)},TransactionBuilder.prototype.buildIncomplete=function(){return this.__build(!0)},TransactionBuilder.prototype.__build=function(e){if(!e){if(!this.tx.ins.length)throw new Error("Transaction has no inputs");if(!this.tx.outs.length)throw new Error("Transaction has no outputs")}var t=this.tx.clone();if(this.inputs.forEach((function(r,i){if(!(r.witnessScriptType||r.redeemScriptType||r.prevOutType||e))throw new Error("Transaction is not complete");var n=function(e,t){var r=e.prevOutType,i=[],n=[];supportedType(r)&&(i=buildStack(r,e.signatures,e.pubKeys,t));var o=!1;if(r===_$templates_61.types.P2SH){if(!t&&!supportedP2SHType(e.redeemScriptType))throw new Error("Impossible to sign this type");supportedType(e.redeemScriptType)&&(i=buildStack(e.redeemScriptType,e.signatures,e.pubKeys,t)),e.redeemScriptType&&(o=!0,r=e.redeemScriptType)}switch(r){case _$templates_61.types.P2WPKH:n=buildStack(_$templates_61.types.P2PKH,e.signatures,e.pubKeys,t);break;case _$templates_61.types.P2WSH:if(!t&&!supportedType(e.witnessScriptType))throw new Error("Impossible to sign this type");supportedType(e.witnessScriptType)&&((n=buildStack(e.witnessScriptType,e.signatures,e.pubKeys,t)).push(e.witnessScript),r=e.witnessScriptType)}return o&&i.push(e.redeemScript),{type:r,script:_$script_59.compile(i),witness:n}}(r,e);if(!e&&!supportedType(n.type)&&n.type!==_$templates_61.types.P2WPKH)throw new Error(n.type+" not supported");t.setInputScript(i,n.script),t.setWitness(i,n.witness)})),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t},TransactionBuilder.prototype.sign=function(e,t,r,i,n,o,a){if(i|=_$transaction_83.SIGHASH_BITCOINCASHBIP143,!this.inputs[e])throw new Error("No input at index: "+e);i=i||_$transaction_83.SIGHASH_ALL;var s=this.inputs[e];if(void 0!==s.redeemScript&&r&&!s.redeemScript.equals(r))throw new Error("Inconsistent redeemScript");var c=t.publicKey||t.getPublicKeyBuffer();if(!canSign(s)){if(void 0!==n){if(void 0!==s.value&&s.value!==n)throw new Error("Input didn't match witnessValue");_$typeforce_471(_$types_85.Satoshi,n),s.value=n}if(canSign(s)||prepareInput(s,c,r,0,o),!canSign(s))throw Error(s.prevOutType+" not supported")}var u=this.tx.hashForCashSignature(e,s.signScript,n,i);if(!s.pubKeys.some((function(e,r){if(!c.equals(e))return!1;if(s.signatures[r])throw new Error("Signature already exists");if(33!==c.length&&s.signType===scriptTypes.P2WPKH)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");var n=t.sign(u,a);return __Buffer_84.isBuffer(n)&&(n=_$ecsignature_53.fromRSBuffer(n)),s.signatures[r]=n.toScriptSignature(i,a),!0})))throw new Error("Key pair cannot sign for this input")},TransactionBuilder.prototype.__canModifyInputs=function(){return this.inputs.every((function(e){return void 0===e.signatures||e.signatures.every((function(e){return!e||signatureHashType(e)&_$transaction_83.SIGHASH_ANYONECANPAY}))}))},TransactionBuilder.prototype.__canModifyOutputs=function(){var e=this.tx.ins.length,t=this.tx.outs.length;return this.inputs.every((function(r){return void 0===r.signatures||r.signatures.every((function(r){if(!r)return!0;var i=31&signatureHashType(r);return i===_$transaction_83.SIGHASH_NONE||(i===_$transaction_83.SIGHASH_SINGLE?e<=t:void 0)}))}))},TransactionBuilder.prototype.__overMaximumFees=function(e){return(this.inputs.reduce((function(e,t){return e+(t.value>>>0)}),0)-this.tx.outs.reduce((function(e,t){return e+t.value}),0))/e>this.maximumFeeRate},_$transaction_builder_84=TransactionBuilder;var _$fastRoot_392={};(function(e){(function(){_$fastRoot_392=function(t,r){if(!Array.isArray(t))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");for(var i=t.length,n=t.concat();i>1;){for(var o=0,a=0;a>24)-3,r=8388607&e,i=__Buffer_48.alloc(32,0);return i.writeUInt32BE(r,28-t),i},Block.calculateMerkleRoot=function(e){if(_$typeforce_471([{getHash:_$types_85.Function}],e),0===e.length)throw TypeError("Cannot compute merkle root for zero transactions");var t=e.map((function(e){return e.getHash()}));return _$fastRoot_392(t,_$crypto_50.hash256)},Block.prototype.checkMerkleRoot=function(){if(!this.transactions)return!1;var e=Block.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)},Block.prototype.checkProofOfWork=function(){var e=this.getHash().reverse(),t=Block.calculateTarget(this.bits);return e.compare(t)<=0},_$block_48=Block,_$templates_61)_$script_59[key]=_$templates_61[key];var _$src_55={ECPair:_$ecpair_52,ECSignature:_$ecsignature_53,HDNode:_$hdnode_54,TransactionBuilder:_$transaction_builder_84,address:_$address_47,crypto:_$crypto_50,networks:_$networks_56,script:_$script_59},_$big_189={exports:{}};!function(e){"use strict";var t,r={},i=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function n(e,t,r){var i=e.constructor,n=t-(e=new i(e)).e,a=e.c;for(a.length>++t&&o(e,n,i.RM),a[0]?r?n=t:(a=e.c,n=e.e+n+1):++n;a.length1?a[0]+"."+a.join("").slice(1):a[0])+(n<0?"e":"e+")+n:e.toString()}function o(e,t,r,i){var n,o=e.c,s=e.e+t+1;if(1===r?i=o[s]>=5:2===r?i=o[s]>5||5==o[s]&&(i||s<0||o[s+1]!==n||1&o[s-1]):3===r?i=i||o[s]!==n||s<0:(i=!1,0!==r&&a("!Big.RM!")),s<1||!o[0])i?(e.e=-t,e.c=[1]):e.c=[e.e=0];else{if(o.length=s--,i)for(;++o[s]>9;)o[s]=0,s--||(++e.e,o.unshift(1));for(s=o.length;!o[--s];o.pop());}return e}function a(e){var t=new Error(e);throw t.name="BigError",t}r.abs=function(){var e=new this.constructor(this);return e.s=1,e},r.cmp=function(e){var t,r=this,i=r.c,n=(e=new r.constructor(e)).c,o=r.s,a=e.s,s=r.e,c=e.e;if(!i[0]||!n[0])return i[0]?o:n[0]?-a:0;if(o!=a)return o;if(t=o<0,s!=c)return s>c^t?1:-1;for(o=-1,a=(s=i.length)<(c=n.length)?s:c;++on[o]^t?1:-1;return s==c?0:s>c^t?1:-1},r.div=function(e){var t=this,r=t.constructor,i=t.c,n=(e=new r(e)).c,s=t.s==e.s?1:-1,c=r.DP;if((c!==~~c||c<0||c>1e6)&&a("!Big.DP!"),!i[0]||!n[0])return i[0]==n[0]&&a(NaN),n[0]||a(s/0),new r(0*s);var u,f,h,l,_,d,p=n.slice(),m=u=n.length,b=i.length,g=i.slice(0,u),y=g.length,v=e,w=v.c=[],$=0,E=c+(v.e=t.e-e.e)+1;for(v.s=s,s=E<0?0:E,p.unshift(0);y++y?1:-1;else for(_=-1,l=0;++_g[_]?1:-1;break}if(!(l<0))break;for(f=y==u?n:p;y;){if(g[--y]E&&o(v,c,r.RM,g[0]!==d),v},r.eq=function(e){return!this.cmp(e)},r.gt=function(e){return this.cmp(e)>0},r.gte=function(e){return this.cmp(e)>-1},r.lt=function(e){return this.cmp(e)<0},r.lte=function(e){return this.cmp(e)<1},r.sub=r.minus=function(e){var t,r,i,n,o=this,a=o.constructor,s=o.s,c=(e=new a(e)).s;if(s!=c)return e.s=-c,o.plus(e);var u=o.c.slice(),f=o.e,h=e.c,l=e.e;if(!u[0]||!h[0])return h[0]?(e.s=-c,e):new a(u[0]?o:0);if(s=f-l){for((n=s<0)?(s=-s,i=u):(l=f,i=h),i.reverse(),c=s;c--;i.push(0));i.reverse()}else for(r=((n=u.length0)for(;c--;u[t++]=0);for(c=t;r>s;){if(u[--r]0?(c=a,t=u):(n=-n,t=s),t.reverse();n--;t.push(0));t.reverse()}for(s.length-u.length<0&&(t=u,u=s,s=t),n=u.length,o=0;n;)o=(s[--n]=s[n]+u[n]+o)/10|0,s[n]%=10;for(o&&(s.unshift(o),++c),n=s.length;0===s[--n];s.pop());return e.c=s,e.e=c,e},r.pow=function(e){var t=this,r=new t.constructor(1),i=r,n=e<0;for((e!==~~e||e<-1e6||e>1e6)&&a("!pow!"),e=n?-e:e;1&e&&(i=i.times(t)),e>>=1;)t=t.times(t);return n?r.div(i):i},r.round=function(e,t){var r=this,i=r.constructor;return null==e?e=0:(e!==~~e||e<0||e>1e6)&&a("!round!"),o(r=new i(r),e,null==t?i.RM:t),r},r.sqrt=function(){var e,t,r,i=this,n=i.constructor,s=i.c,c=i.s,u=i.e,f=new n("0.5");if(!s[0])return new n(i);c<0&&a(NaN),0===(c=Math.sqrt(i.toString()))||c===1/0?((e=s.join("")).length+u&1||(e+="0"),(t=new n(Math.sqrt(e).toString())).e=((u+1)/2|0)-(u<0||1&u)):t=new n(c.toString()),c=t.e+(n.DP+=4);do{r=t,t=f.times(r.plus(i.div(r)))}while(r.c.slice(0,c).join("")!==t.c.slice(0,c).join(""));return o(t,n.DP-=4,n.RM),t},r.mul=r.times=function(e){var t,r=this,i=r.constructor,n=r.c,o=(e=new i(e)).c,a=n.length,s=o.length,c=r.e,u=e.e;if(e.s=r.s==e.s?1:-1,!n[0]||!o[0])return new i(0*e.s);for(e.e=c+u,ac;)s=t[u]+o[c]*n[u-c-1]+s,t[u--]=s%10,s=s/10|0;t[u]=(t[u]+s)%10}for(s&&++e.e,t[0]||t.shift(),c=t.length;!t[--c];t.pop());return e.c=t,e},r.toString=r.valueOf=r.toJSON=function(){var e=this,t=e.constructor,r=e.e,i=e.c.join(""),n=i.length;if(r<=t.E_NEG||r>=t.E_POS)i=i.charAt(0)+(n>1?"."+i.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;i="0"+i);i="0."+i}else if(r>0)if(++r>n)for(r-=n;r--;i+="0");else r1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&e.c[0]?"-"+i:i},r.toExponential=function(e){return null==e?e=this.c.length-1:(e!==~~e||e<0||e>1e6)&&a("!toExp!"),n(this,e,1)},r.toFixed=function(e){var t,r=this,i=r.constructor,o=i.E_NEG,s=i.E_POS;return i.E_NEG=-(i.E_POS=1/0),null==e?t=r.toString():e===~~e&&e>=0&&e<=1e6&&(t=n(r,r.e+e),r.s<0&&r.c[0]&&t.indexOf("-")<0&&(t="-"+t)),i.E_NEG=o,i.E_POS=s,t||a("!toFix!"),t},r.toPrecision=function(e){return null==e?this.toString():((e!==~~e||e<1||e>1e6)&&a("!toPre!"),n(this,e-1,2))},t=function e(){function t(r){var n=this;if(!(n instanceof t))return void 0===r?e():new t(r);r instanceof t?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(e,t){var r,n,o;for(0===t&&1/t<0?t="-0":i.test(t+="")||a(NaN),e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),o=t.length,n=0;n0&&"0"==t.charAt(--o););for(e.e=r-n-1,e.c=[];n<=o;e.c.push(+t.charAt(n++)));}}(n,r),n.constructor=t}return t.prototype=r,t.DP=20,t.RM=1,t.E_NEG=-7,t.E_POS=21,t}(),"function"==typeof define&&define.amd?define((function(){return t})):_$big_189.exports?(_$big_189.exports=t,_$big_189.exports.Big=t):e.Big=t}(this),_$big_189=_$big_189.exports;var _$satoshiBitcoin_426={};function toNumber(e){return Number(e)}Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&e%1==0}),_$satoshiBitcoin_426={toBitcoin:function(e){var t=typeof e;if("string"===t&&(e=toNumber(e),t="number"),"number"!==t)throw new TypeError("toBitcoin must be called on a number or string, got "+t);if(!Number.isInteger(e))throw new TypeError("toBitcoin must be called on a whole number or string format whole number");var r=new _$big_189(e);return Number(r.div(1e8))},toSatoshi:function(e){var t=typeof e;if("string"===t&&(e=toNumber(e),t="number"),"number"!==t)throw new TypeError("toSatoshi must be called on a number or string, got "+t);var r=new _$big_189(e);return Number(r.times(1e8))}};var _$bufferEquals_264={};(function(e){(function(){"use strict";_$bufferEquals_264=function(t,r){if(!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return!0;if("function"==typeof t.equals)return t.equals(r);if(t.length!==r.length)return!1;for(var i=0;i=r)throw RangeError(i)}}).call(this)}).call(this,{isBuffer:_$isBuffer_389});var _$der_433={},__Buffer_433=_$safeBuffer_424.Buffer,EC_PRIVKEY_EXPORT_DER_COMPRESSED=__Buffer_433.from([48,129,211,2,1,1,4,32,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,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=__Buffer_433.from([48,130,1,19,2,1,1,4,32,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,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,0,0,0]);_$der_433.privateKeyExport=function(e,t,r){var i=__Buffer_433.from(r?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return e.copy(i,r?8:9),t.copy(i,r?181:214),i},_$der_433.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+i-2]<<8:0);if(!(t<(r+=i)+n||t32||t1&&0===t[i]&&!(128&t[i+1]);--r,++i);for(var n=__Buffer_433.concat([__Buffer_433.from([0]),e.s]),o=33,a=0;o>1&&0===n[a]&&!(128&n[a+1]);--o,++a);return _$bip66_212.encode(t.slice(i),n.slice(a))},_$der_433.signatureImport=function(e){var t=__Buffer_433.alloc(32,0),r=__Buffer_433.alloc(32,0);try{var i=_$bip66_212.decode(e);if(33===i.r.length&&0===i.r[0]&&(i.r=i.r.slice(1)),i.r.length>32)throw new Error("R length is too long");if(33===i.s.length&&0===i.s[0]&&(i.s=i.s.slice(1)),i.s.length>32)throw new Error("S length is too long")}catch(n){return}return i.r.copy(t,32-i.r.length),i.s.copy(r,32-i.s.length),{r:t,s:r}},_$der_433.signatureImportLax=function(e){var t=__Buffer_433.alloc(32,0),r=__Buffer_433.alloc(32,0),i=e.length,n=0;if(48===e[n++]){var o=e[n++];if(!(128&o&&(n+=o-128)>i)&&2===e[n++]){var a=e[n++];if(128&a){if(n+(o=a-128)>i)return;for(;o>0&&0===e[n];n+=1,o-=1);for(a=0;o>0;n+=1,o-=1)a=(a<<8)+e[n]}if(!(a>i-n)){var s=n;if(n+=a,2===e[n++]){var c=e[n++];if(128&c){if(n+(o=c-128)>i)return;for(;o>0&&0===e[n];n+=1,o-=1);for(c=0;o>0;n+=1,o-=1)c=(c<<8)+e[n]}if(!(c>i-n)){var u=n;for(n+=c;a>0&&0===e[s];a-=1,s+=1);if(!(a>32)){var f=e.slice(s,s+a);for(f.copy(t,32-f.length);c>0&&0===e[u];c-=1,u+=1);if(!(c>32)){var h=e.slice(u,u+c);return h.copy(r,32-h.length),{r:t,s:r}}}}}}}}};var _$messages_436={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"};function initCompressedValue(e,t){return void 0===e?t:(_$assert_432.isBoolean(e,_$messages_436.COMPRESSED_TYPE_INVALID),e)}var _$lib_435=function(e){return{privateKeyVerify:function(t){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){_$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),r=initCompressedValue(r,!0);var i=e.privateKeyExport(t,r);return _$der_433.privateKeyExport(t,i,r)},privateKeyImport:function(t){if(_$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),(t=_$der_433.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(_$messages_436.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),_$assert_432.isBuffer(r,_$messages_436.TWEAK_TYPE_INVALID),_$assert_432.isBufferLength(r,32,_$messages_436.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),_$assert_432.isBuffer(r,_$messages_436.TWEAK_TYPE_INVALID),_$assert_432.isBufferLength(r,32,_$messages_436.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return _$assert_432.isBuffer(t,_$messages_436.EC_PRIVATE_KEY_TYPE_INVALID),_$assert_432.isBufferLength(t,32,_$messages_436.EC_PRIVATE_KEY_LENGTH_INVALID),r=initCompressedValue(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return _$assert_432.isBuffer(t,_$messages_436.EC_PUBLIC_KEY_TYPE_INVALID),_$assert_432.isBufferLength2(t,33,65,_$messages_436.EC_PUBLIC_KEY_LENGTH_INVALID),r=initCompressedValue(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return _$assert_432.isBuffer(t,_$messages_436.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return _$assert_432.isBuffer(t,_$messages_436.EC_PUBLIC_KEY_TYPE_INVALID),_$assert_432.isBufferLength2(t,33,65,_$messages_436.EC_PUBLIC_KEY_LENGTH_INVALID),_$assert_432.isBuffer(r,_$messages_436.TWEAK_TYPE_INVALID),_$assert_432.isBufferLength(r,32,_$messages_436.TWEAK_LENGTH_INVALID),i=initCompressedValue(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return _$assert_432.isBuffer(t,_$messages_436.EC_PUBLIC_KEY_TYPE_INVALID),_$assert_432.isBufferLength2(t,33,65,_$messages_436.EC_PUBLIC_KEY_LENGTH_INVALID),_$assert_432.isBuffer(r,_$messages_436.TWEAK_TYPE_INVALID),_$assert_432.isBufferLength(r,32,_$messages_436.TWEAK_LENGTH_INVALID),i=initCompressedValue(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){_$assert_432.isArray(t,_$messages_436.EC_PUBLIC_KEYS_TYPE_INVALID),_$assert_432.isLengthGTZero(t,_$messages_436.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function s(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.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);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(i=0,n=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,c=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,l=Math.min(u,t.length-1),_=Math.max(0,u-e.length+1);_<=l;_++){var d=u-_|0;f+=(a=(n=0|e.words[d])*(o=0|t.words[_])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-s.length]+s+r:s+r,(i+=2)>=26&&(i-=26,o--)}for(0!==n&&(r=n.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 h=u[e],l=f[e];r="";var _=this.clone();for(_.negative=0;!_.isZero();){var d=_.modn(l).toString(e);r=(_=_.idivn(l)).isZero()?d+r:c[h-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}},i.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,0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return this.toArrayLike(n,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),n=r||Math.max(1,i);this.strip();var o,a,s="le"===t,c=new e(n),u=this.clone();if(s){for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),c[a]=o;for(;a=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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.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)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){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()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){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,i=e):(r=e,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.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,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,_=0|a[1],d=8191&_,p=_>>>13,m=0|a[2],b=8191&m,g=m>>>13,y=0|a[3],v=8191&y,w=y>>>13,$=0|a[4],E=8191&$,S=$>>>13,A=0|a[5],B=8191&A,k=A>>>13,M=0|a[6],T=8191&M,R=M>>>13,I=0|a[7],P=8191&I,x=I>>>13,O=0|a[8],C=8191&O,N=O>>>13,L=0|a[9],D=8191&L,U=L>>>13,H=0|s[0],j=8191&H,z=H>>>13,q=0|s[1],K=8191&q,F=q>>>13,G=0|s[2],V=8191&G,W=G>>>13,Y=0|s[3],J=8191&Y,X=Y>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,le=fe>>>13,_e=0|s[9],de=8191&_e,pe=_e>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(i=Math.imul(h,j))|0)+((8191&(n=(n=Math.imul(h,z))+Math.imul(l,j)|0))<<13)|0;u=((o=Math.imul(l,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,j),n=(n=Math.imul(d,z))+Math.imul(p,j)|0,o=Math.imul(p,z);var be=(u+(i=i+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,F)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,F)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,z))+Math.imul(g,j)|0,o=Math.imul(g,z),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,F)|0)+Math.imul(p,K)|0,o=o+Math.imul(p,F)|0;var ge=(u+(i=i+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,V)|0))<<13)|0;u=((o=o+Math.imul(l,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(v,j),n=(n=Math.imul(v,z))+Math.imul(w,j)|0,o=Math.imul(w,z),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,F)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,F)|0,i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,W)|0;var ye=(u+(i=i+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(l,J)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,z))+Math.imul(S,j)|0,o=Math.imul(S,z),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,F)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,F)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,W)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(p,J)|0,o=o+Math.imul(p,X)|0;var ve=(u+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(B,j),n=(n=Math.imul(B,z))+Math.imul(k,j)|0,o=Math.imul(k,z),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,F)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,F)|0,i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,W)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,ee)|0;var we=(u+(i=i+Math.imul(h,re)|0)|0)+((8191&(n=(n=n+Math.imul(h,ie)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,z))+Math.imul(R,j)|0,o=Math.imul(R,z),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,F)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,F)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,i=i+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ie)|0;var $e=(u+(i=i+Math.imul(h,oe)|0)|0)+((8191&(n=(n=n+Math.imul(h,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(n>>>13)|0)+($e>>>26)|0,$e&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,z))+Math.imul(x,j)|0,o=Math.imul(x,z),i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,F)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,F)|0,i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(E,J)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Ee=(u+(i=i+Math.imul(h,ce)|0)|0)+((8191&(n=(n=n+Math.imul(h,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,j),n=(n=Math.imul(C,z))+Math.imul(N,j)|0,o=Math.imul(N,z),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,F)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,F)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(B,J)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,ue)|0;var Se=(u+(i=i+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,j),n=(n=Math.imul(D,z))+Math.imul(U,j)|0,o=Math.imul(U,z),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,F)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,F)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(v,oe)|0,n=(n=n+Math.imul(v,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,ue)|0,i=i+Math.imul(d,he)|0,n=(n=n+Math.imul(d,le)|0)+Math.imul(p,he)|0,o=o+Math.imul(p,le)|0;var Ae=(u+(i=i+Math.imul(h,de)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,F))+Math.imul(U,K)|0,o=Math.imul(U,F),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,W)|0,i=i+Math.imul(P,J)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,i=i+Math.imul(b,he)|0,n=(n=n+Math.imul(b,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Be=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;u=((o=o+Math.imul(p,pe)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,W))+Math.imul(U,V)|0,o=Math.imul(U,W),i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(B,oe)|0,n=(n=n+Math.imul(B,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,i=i+Math.imul(v,he)|0,n=(n=n+Math.imul(v,le)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,le)|0;var ke=(u+(i=i+Math.imul(b,de)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(g,de)|0))<<13)|0;u=((o=o+Math.imul(g,pe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,J),n=(n=Math.imul(D,X))+Math.imul(U,J)|0,o=Math.imul(U,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,i=i+Math.imul(E,he)|0,n=(n=n+Math.imul(E,le)|0)+Math.imul(S,he)|0,o=o+Math.imul(S,le)|0;var Me=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,pe)|0)+Math.imul(w,de)|0))<<13)|0;u=((o=o+Math.imul(w,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,i=i+Math.imul(T,ce)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,i=i+Math.imul(B,he)|0,n=(n=n+Math.imul(B,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var Te=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,de)|0))<<13)|0;u=((o=o+Math.imul(S,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,i=i+Math.imul(T,he)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Re=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,pe)|0)+Math.imul(k,de)|0))<<13)|0;u=((o=o+Math.imul(k,pe)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,oe),n=(n=Math.imul(D,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,i=i+Math.imul(P,he)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Ie=(u+(i=i+Math.imul(T,de)|0)|0)+((8191&(n=(n=n+Math.imul(T,pe)|0)+Math.imul(R,de)|0))<<13)|0;u=((o=o+Math.imul(R,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),i=i+Math.imul(C,he)|0,n=(n=n+Math.imul(C,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Pe=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,pe)|0)+Math.imul(x,de)|0))<<13)|0;u=((o=o+Math.imul(x,pe)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,he),n=(n=Math.imul(D,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(u+(i=i+Math.imul(C,de)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(N,de)|0))<<13)|0;u=((o=o+Math.imul(N,pe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Oe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,pe))+Math.imul(U,de)|0))<<13)|0;return u=((o=Math.imul(U,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=be,c[2]=ge,c[3]=ye,c[4]=ve,c[5]=we,c[6]=$e,c[7]=Ee,c[8]=Se,c[9]=Ae,c[10]=Be,c[11]=ke,c[12]=Me,c[13]=Te,c[14]=Re,c[15]=Ie,c[16]=Pe,c[17]=xe,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function _(e,t,r){return(new d).mulp(e,t,r)}function d(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):_(this,e,t)},d.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return i},d.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n>>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>>n<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-n|f>>>n,u=f&a}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){var t=e%26,r=(e-t)/26,i=1<>>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},i.prototype.isubn=function(e){if(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)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(a=0,i=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,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}},i.prototype.divmod=function(e,t,r){return this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.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,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){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},i.prototype.idivn=function(e){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()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new i(1),o=new i(0),a=new i(0),s=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var _=0,d=1;0==(r.words[0]&d)&&_<26;++_,d<<=1);if(_>0)for(r.iushrn(_);_-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(f)),a.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(s)):(r.isub(t),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:r.iushln(c)}},i.prototype._invmp=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new i(1),a=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},i.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 i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new w(e)},i.prototype.toRed=function(e){return e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return this._forceRed(e)},i.prototype.redAdd=function(e){return this.red.add(this,e)},i.prototype.redIAdd=function(e){return this.red.iadd(this,e)},i.prototype.redSub=function(e){return this.red.sub(this,e)},i.prototype.redISub=function(e){return this.red.isub(this,e)},i.prototype.redShl=function(e){return this.red.shl(this,e)},i.prototype.redMul=function(e){return this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return this.red._verify1(this),this.red.pow(this,e)};var p={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function $(e){w.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},r(b,m),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=o}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},b.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]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(p[e])return p[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new g;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new v}return p[e]=t,t},w.prototype._verify1=function(e){},w.prototype._verify2=function(e,t){},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();if(3===this.m.andln(3)){var t=this.m.add(new i(1)).iushrn(2);return this.pow(e,t)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);var o=new i(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,s).cmp(a);)c.redIAdd(a);for(var u=this.pow(c,r),f=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=n;0!==h.cmp(o);){for(var _=h,d=0;0!==_.cmp(o);d++)_=_.redSqr();var p=this.pow(u,new i(1).iushln(l-d-1));f=f.redMul(p),u=p.redSqr(),h=h.redMul(u),l=d}return f},w.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},w.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new $(e)},r($,w),$.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},$.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},$.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},$.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},$.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(_$bn_214,this),_$bn_214=_$bn_214.exports;var _$package_349={version:"6.5.4"},_$minimalisticAssert_394={};function __assert_394(e,t){if(!e)throw new Error(t||"Assertion failed")}_$minimalisticAssert_394=__assert_394,__assert_394.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var _$utils_395={},utils=_$utils_395;function zero2(e){return 1===e.length?"0"+e:e}function toHex(e){for(var t="",r=0;r>8,a=255&n;o?r.push(o,a):r.push(a)}return r},utils.zero2=zero2,utils.toHex=toHex,utils.encode=function(e,t){return"hex"===t?toHex(e):e};var _$utils_348={},__utils_348=_$utils_348;__utils_348.assert=_$minimalisticAssert_394,__utils_348.toArray=_$utils_395.toArray,__utils_348.zero2=_$utils_395.zero2,__utils_348.toHex=_$utils_395.toHex,__utils_348.encode=_$utils_395.encode,__utils_348.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-c:c,o.isubn(s)):s=0,i[a]=s,o.iushrn(1)}return i},__utils_348.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+n&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(i=e.andln(7)+n&7)&&5!==i||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!=(i=t.andln(7)+o&7)&&5!==i||2!==c?u:-u,r[1].push(s),2*n===a+1&&(n=1-n),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},__utils_348.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},__utils_348.parseBytes=function(e){return"string"==typeof e?__utils_348.toArray(e,"hex"):e},__utils_348.intFromLE=function(e){return new _$bn_214(e,"hex","le")};var _$brorand_215={},r;function Rand(e){this.rand=e}if(_$brorand_215=function(e){return r||(r=new Rand(null)),r.generate(e)},_$brorand_215.Rand=Rand,Rand.prototype.generate=function(e){return this._rand(e)},Rand.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 BasePoint(e,t){this.curve=e,this.type=t,this.precomputed=null}_$utils_348.assert,_$base_335=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=getNAF(t,1,this._bitLength),n=(1<=o;c--)a=(a<<1)+i[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=n;h>0;h--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];a="affine"===e.type?u>0?a.mixedAdd(n[u-1>>1]):a.mixedAdd(n[-u-1>>1].neg()):u>0?a.add(n[u-1>>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},BaseCurve.prototype._wnafMulAdd=function(e,t,r,i,n){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,h=0;for(o=0;o=1;o-=2){var _=o-1,d=o;if(1===c[_]&&1===c[d]){var p=[t[_],null,null,t[d]];0===t[_].y.cmp(t[d].y)?(p[1]=t[_].add(t[d]),p[2]=t[_].toJ().mixedAdd(t[d].neg())):0===t[_].y.cmp(t[d].y.redNeg())?(p[1]=t[_].toJ().mixedAdd(t[d]),p[2]=t[_].add(t[d].neg())):(p[1]=t[_].toJ().mixedAdd(t[d]),p[2]=t[_].toJ().mixedAdd(t[d].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=getJSF(r[_],r[d]);for(h=Math.max(b[0].length,h),f[_]=new Array(h),f[d]=new Array(h),a=0;a=0;o--){for(var $=0;o>=0;){var E=!0;for(a=0;a=0&&$++,v=v.dblp($),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),v="affine"===s.type?v.mixedAdd(s):v.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},BasePoint.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},ShortCurve.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),c=n.mul(r.b),u=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},ShortCurve.prototype.pointFromX=function(e,t){(e=new _$bn_214(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},ShortCurve.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},__Point_339.prototype.isInfinity=function(){return this.inf},__Point_339.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),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},__Point_339.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(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},__Point_339.prototype.getX=function(){return this.x.fromRed()},__Point_339.prototype.getY=function(){return this.y.fromRed()},__Point_339.prototype.mul=function(e){return e=new _$bn_214(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},__Point_339.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},__Point_339.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},__Point_339.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))},__Point_339.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,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},__Point_339.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},_$inherits_browser_388(JPoint,_$base_335.BasePoint),ShortCurve.prototype.jpoint=function(e,t,r){return new JPoint(this,e,t,r)},JPoint.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),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=i.redMul(u),l=c.redSqr().redIAdd(f).redISub(h).redISub(h),_=c.redMul(h.redISub(l)).redISub(o.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,_,d)},JPoint.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),h=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(h)).redISub(n.redMul(u)),_=this.z.redMul(a);return this.curve.jpoint(h,l,_)},JPoint.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _$mont_338={};function MontCurve(e){_$base_335.call(this,"mont",e),this.a=new _$bn_214(e.a,16).toRed(this.red),this.b=new _$bn_214(e.b,16).toRed(this.red),this.i4=new _$bn_214(4).toRed(this.red).redInvm(),this.two=new _$bn_214(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function __Point_338(e,t,r){_$base_335.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new _$bn_214(t,16),this.z=new _$bn_214(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}_$inherits_browser_388(MontCurve,_$base_335),_$mont_338=MontCurve,MontCurve.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},_$inherits_browser_388(__Point_338,_$base_335.BasePoint),MontCurve.prototype.decodePoint=function(e,t){return this.point(_$utils_348.toArray(e,t),1)},MontCurve.prototype.point=function(e,t){return new __Point_338(this,e,t)},MontCurve.prototype.pointFromJSON=function(e){return __Point_338.fromJSON(this,e)},__Point_338.prototype.precompute=function(){},__Point_338.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},__Point_338.fromJSON=function(e,t){return new __Point_338(e,t[0],t[1]||e.one)},__Point_338.prototype.inspect=function(){return this.isInfinity()?"":""},__Point_338.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},__Point_338.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},__Point_338.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},__Point_338.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},__Point_338.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},__Point_338.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},__Point_338.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},__Point_338.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},__Point_338.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},__Point_338.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var _$edwards_336={};function EdwardsCurve(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,_$base_335.call(this,"edwards",e),this.a=new _$bn_214(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _$bn_214(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _$bn_214(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),this.oneC=1==(0|e.c)}function __Point_336(e,t,r,i,n){_$base_335.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(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 _$bn_214(t,16),this.y=new _$bn_214(r,16),this.z=i?new _$bn_214(i,16):this.curve.one,this.t=n&&new _$bn_214(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.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()))))}_$utils_348.assert,_$inherits_browser_388(EdwardsCurve,_$base_335),_$edwards_336=EdwardsCurve,EdwardsCurve.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},EdwardsCurve.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},EdwardsCurve.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},EdwardsCurve.prototype.pointFromX=function(e,t){(e=new _$bn_214(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(n.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},EdwardsCurve.prototype.pointFromY=function(e,t){(e=new _$bn_214(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},EdwardsCurve.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},_$inherits_browser_388(__Point_336,_$base_335.BasePoint),EdwardsCurve.prototype.pointFromJSON=function(e){return __Point_336.fromJSON(this,e)},EdwardsCurve.prototype.point=function(e,t,r,i){return new __Point_336(this,e,t,r,i)},__Point_336.fromJSON=function(e,t){return new __Point_336(e,t[0],t[1],t[2])},__Point_336.prototype.inspect=function(){return this.isInfinity()?"":""},__Point_336.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},__Point_336.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),c=n.redMul(a),u=o.redMul(s),f=n.redMul(s),h=a.redMul(o);return this.curve.point(c,u,h,f)},__Point_336.prototype._projDbl=function(){var e,t,r,i,n,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(i.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),o=u.redSub(n).redISub(n),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(i.redSub(c)),r=u.redMul(o))}else i=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),e=this.curve._mulC(a.redISub(i)).redMul(o),t=this.curve._mulC(i).redMul(s.redISub(c)),r=i.redMul(o);return this.curve.point(e,t,r)},__Point_336.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},__Point_336.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)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),h=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,h)},__Point_336.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=i.redMul(c).redMul(f);return this.curve.twisted?(t=i.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=i.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,t,r)},__Point_336.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},__Point_336.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},__Point_336.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},__Point_336.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},__Point_336.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},__Point_336.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},__Point_336.prototype.getX=function(){return this.normalize(),this.x.fromRed()},__Point_336.prototype.getY=function(){return this.normalize(),this.y.fromRed()},__Point_336.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},__Point_336.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(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},__Point_336.prototype.toP=__Point_336.prototype.normalize,__Point_336.prototype.mixedAdd=__Point_336.prototype.add;var _$curve_337={},__curve_337=_$curve_337;__curve_337.base=_$base_335,__curve_337.short=_$short_339,__curve_337.mont=_$mont_338,__curve_337.edwards=_$edwards_336;var _$utils_385={};function isSurrogatePair(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function htonl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function __zero2_385(e){return 1===e.length?"0"+e:e}function zero8(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}_$utils_385.inherits=_$inherits_browser_388,_$utils_385.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,r[i++]=63&o|128):isSurrogatePair(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return n},_$utils_385.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},_$utils_385.rotr32=function(e,t){return e>>>t|e<<32-t},_$utils_385.rotl32=function(e,t){return e<>>32-t},_$utils_385.sum32=function(e,t){return e+t>>>0},_$utils_385.sum32_3=function(e,t,r){return e+t+r>>>0},_$utils_385.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},_$utils_385.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},_$utils_385.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},_$utils_385.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},_$utils_385.sum64_lo=function(e,t,r,i){return t+i>>>0},_$utils_385.sum64_4_hi=function(e,t,r,i,n,o,a,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},_$utils_385.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},_$utils_385.sum64_5_hi=function(e,t,r,i,n,o,a,s,c,u){var f=0,h=t;return f+=(h=h+i>>>0)>>0)>>0)>>0)>>0},_$utils_385.sum64_5_lo=function(e,t,r,i,n,o,a,s,c,u){return t+i+o+s+u>>>0},_$utils_385.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},_$utils_385.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},_$utils_385.shr64_hi=function(e,t,r){return e>>>r},_$utils_385.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var _$common_375={};function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_$common_375.BlockHash=BlockHash,BlockHash.prototype.update=function(e,t){if(e=_$utils_385.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=_$utils_385.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o>>3},_$common_384.g1_256=function(e){return rotr32(e,17)^rotr32(e,19)^e>>>10};var _$1_379={},rotl32=_$utils_385.rotl32,sum32=_$utils_385.sum32,sum32_5=_$utils_385.sum32_5,ft_1=_$common_384.ft_1,__BlockHash_379=_$common_375.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;__BlockHash_379.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_$utils_385.inherits(SHA1,__BlockHash_379),_$1_379=SHA1,SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;ithis.blockSize&&(e=(new this.Hash).update(e).digest());for(var t=e.length;tthis.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=_$utils_395.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var _$signature_343={};function Signature(e,t){if(e instanceof Signature)return e;this._importDER(e,t)||(this.r=new _$bn_214(e.r,16),this.s=new _$bn_214(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function Position(){this.place=0}function getLength(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,a=t.place;o>>=0;return!(n<=127)&&(t.place=a,n)}function rmPadding(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}_$utils_348.assert,_$signature_343=Signature,Signature.prototype._importDER=function(e,t){e=_$utils_348.toArray(e,t);var r=new Position;if(48!==e[r.place++])return!1;var i=getLength(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=getLength(e,r);if(!1===n)return!1;var o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var a=getLength(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new _$bn_214(o),this.s=new _$bn_214(s),this.recoveryParam=null,!0},Signature.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=rmPadding(t),r=rmPadding(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];constructLength(i,t.length),(i=i.concat(t)).push(2),constructLength(i,r.length);var n=i.concat(r),o=[48];return constructLength(o,n.length),o=o.concat(n),_$utils_348.encode(o,e)};var _$ec_341={},__KeyPair_341=(_$utils_348.assert,_$key_342);function EC(e){if(!(this instanceof EC))return new EC(e);"string"==typeof e&&(e=_$curves_340[e]),e instanceof _$curves_340.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}_$ec_341=EC,EC.prototype.keyPair=function(e){return new __KeyPair_341(this,e)},EC.prototype.keyFromPrivate=function(e,t){return __KeyPair_341.fromPrivate(this,e,t)},EC.prototype.keyFromPublic=function(e,t){return __KeyPair_341.fromPublic(this,e,t)},EC.prototype.genKeyPair=function(e){e||(e={});for(var t=new _$hmacDrbg_386({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||_$brorand_215(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new _$bn_214(2));;){var n=new _$bn_214(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},EC.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},EC.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new _$bn_214(e,16));for(var n=this.n.byteLength(),o=t.getPrivate().toArray("be",n),a=e.toArray("be",n),s=new _$hmacDrbg_386({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new _$bn_214(1)),u=0;;u++){var f=i.k?i.k(u):new _$bn_214(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var l=h.getX(),_=l.umod(this.n);if(0!==_.cmpn(0)){var d=f.invm(this.n).mul(_.mul(t.getPrivate()).iadd(e));if(0!==(d=d.umod(this.n)).cmpn(0)){var p=(h.getY().isOdd()?1:0)|(0!==l.cmp(_)?2:0);return i.canonical&&d.cmp(this.nh)>0&&(d=this.n.sub(d),p^=1),new _$signature_343({r:_,s:d,recoveryParam:p})}}}}}},EC.prototype.verify=function(e,t,r,i){e=this._truncateToN(new _$bn_214(e,16)),r=this.keyFromPublic(r,i);var n=(t=new _$signature_343(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(n).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(n):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(n)},EC.prototype.recoverPubKey=function(e,t,r,i){t=new _$signature_343(t,i);var n=this.n,o=new _$bn_214(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(n),h=n.sub(o).mul(f).umod(n),l=s.mul(f).umod(n);return this.g.mulAdd(h,a,l)},EC.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new _$signature_343(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var _$key_345={},parseBytes=(_$utils_348.assert,_$utils_348.parseBytes),cachedProperty=_$utils_348.cachedProperty;function __KeyPair_345(e,t){this.eddsa=e,this._secret=parseBytes(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=parseBytes(t.pub)}__KeyPair_345.fromPublic=function(e,t){return t instanceof __KeyPair_345?t:new __KeyPair_345(e,{pub:t})},__KeyPair_345.fromSecret=function(e,t){return t instanceof __KeyPair_345?t:new __KeyPair_345(e,{secret:t})},__KeyPair_345.prototype.secret=function(){return this._secret},cachedProperty(__KeyPair_345,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),cachedProperty(__KeyPair_345,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),cachedProperty(__KeyPair_345,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),cachedProperty(__KeyPair_345,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),cachedProperty(__KeyPair_345,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),cachedProperty(__KeyPair_345,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),__KeyPair_345.prototype.sign=function(e){return this.eddsa.sign(e,this)},__KeyPair_345.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},__KeyPair_345.prototype.getSecret=function(e){return _$utils_348.encode(this.secret(),e)},__KeyPair_345.prototype.getPublic=function(e){return _$utils_348.encode(this.pubBytes(),e)},_$key_345=__KeyPair_345;var _$signature_346={},__cachedProperty_346=(_$utils_348.assert,_$utils_348.cachedProperty),__parseBytes_346=_$utils_348.parseBytes;function __Signature_346(e,t){this.eddsa=e,"object"!=typeof t&&(t=__parseBytes_346(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof _$bn_214&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}__cachedProperty_346(__Signature_346,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),__cachedProperty_346(__Signature_346,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),__cachedProperty_346(__Signature_346,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),__cachedProperty_346(__Signature_346,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),__Signature_346.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},__Signature_346.prototype.toHex=function(){return _$utils_348.encode(this.toBytes(),"hex").toUpperCase()},_$signature_346=__Signature_346;var _$eddsa_344={},__parseBytes_344=(_$utils_348.assert,_$utils_348.parseBytes);function EDDSA(e){if(!(this instanceof EDDSA))return new EDDSA(e);e=_$curves_340[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=_$hash_374.sha512}_$eddsa_344=EDDSA,EDDSA.prototype.sign=function(e,t){e=__parseBytes_344(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},EDDSA.prototype.verify=function(e,t,r){e=__parseBytes_344(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},EDDSA.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0)return null;var i=(r=r.toRed(ecparams.red)).redSqr().redIMul(r).redIAdd(ecparams.b).redSqrt();return 3===e!==i.isOdd()&&(i=i.redNeg()),ec.keyPair({pub:{x:r,y:i}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var i=new _$bn_214(t),n=new _$bn_214(r);if(i.cmp(ecparams.p)>=0||n.cmp(ecparams.p)>=0)return null;if(i=i.toRed(ecparams.red),n=n.toRed(ecparams.red),(6===e||7===e)&&n.isOdd()!==(7===e))return null;var o=i.redSqr().redIMul(i);return n.redSqr().redISub(o.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:i,y:n}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}_$elliptic_434.privateKeyVerify=function(e){var t=new _$bn_214(e);return t.cmp(ecparams.n)<0&&!t.isZero()},_$elliptic_434.privateKeyExport=function(e,t){var r=new _$bn_214(e);if(r.cmp(ecparams.n)>=0||r.isZero())throw new Error(_$messages_436.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return __Buffer_434.from(ec.keyFromPrivate(e).getPublic(t,!0))},_$elliptic_434.privateKeyNegate=function(e){var t=new _$bn_214(e);return t.isZero()?__Buffer_434.alloc(32):ecparams.n.sub(t).umod(ecparams.n).toArrayLike(__Buffer_434,"be",32)},_$elliptic_434.privateKeyModInverse=function(e){var t=new _$bn_214(e);if(t.cmp(ecparams.n)>=0||t.isZero())throw new Error(_$messages_436.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(ecparams.n).toArrayLike(__Buffer_434,"be",32)},_$elliptic_434.privateKeyTweakAdd=function(e,t){var r=new _$bn_214(t);if(r.cmp(ecparams.n)>=0)throw new Error(_$messages_436.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new _$bn_214(e)),r.cmp(ecparams.n)>=0&&r.isub(ecparams.n),r.isZero())throw new Error(_$messages_436.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(__Buffer_434,"be",32)},_$elliptic_434.privateKeyTweakMul=function(e,t){var r=new _$bn_214(t);if(r.cmp(ecparams.n)>=0||r.isZero())throw new Error(_$messages_436.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new _$bn_214(e)),r.cmp(ecparams.n)&&(r=r.umod(ecparams.n)),r.toArrayLike(__Buffer_434,"be",32)},_$elliptic_434.publicKeyCreate=function(e,t){var r=new _$bn_214(e);if(r.cmp(ecparams.n)>=0||r.isZero())throw new Error(_$messages_436.EC_PUBLIC_KEY_CREATE_FAIL);return __Buffer_434.from(ec.keyFromPrivate(e).getPublic(t,!0))},_$elliptic_434.publicKeyConvert=function(e,t){var r=loadPublicKey(e);if(null===r)throw new Error(_$messages_436.EC_PUBLIC_KEY_PARSE_FAIL);return __Buffer_434.from(r.getPublic(t,!0))},_$elliptic_434.publicKeyVerify=function(e){return null!==loadPublicKey(e)},_$elliptic_434.publicKeyTweakAdd=function(e,t,r){var i=loadPublicKey(e);if(null===i)throw new Error(_$messages_436.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new _$bn_214(t)).cmp(ecparams.n)>=0)throw new Error(_$messages_436.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var n=ecparams.g.mul(t).add(i.pub);if(n.isInfinity())throw new Error(_$messages_436.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return __Buffer_434.from(n.encode(!0,r))},_$elliptic_434.publicKeyTweakMul=function(e,t,r){var i=loadPublicKey(e);if(null===i)throw new Error(_$messages_436.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new _$bn_214(t)).cmp(ecparams.n)>=0||t.isZero())throw new Error(_$messages_436.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return __Buffer_434.from(i.pub.mul(t).encode(!0,r))},_$elliptic_434.publicKeyCombine=function(e,t){for(var r=new Array(e.length),i=0;i=0||r.cmp(ecparams.n)>=0)throw new Error(_$messages_436.ECDSA_SIGNATURE_PARSE_FAIL);var i=__Buffer_434.from(e);return 1===r.cmp(ec.nh)&&ecparams.n.sub(r).toArrayLike(__Buffer_434,"be",32).copy(i,32),i},_$elliptic_434.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new _$bn_214(t).cmp(ecparams.n)>=0||new _$bn_214(r).cmp(ecparams.n)>=0)throw new Error(_$messages_436.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},_$elliptic_434.signatureImport=function(e){var t=new _$bn_214(e.r);t.cmp(ecparams.n)>=0&&(t=new _$bn_214(0));var r=new _$bn_214(e.s);return r.cmp(ecparams.n)>=0&&(r=new _$bn_214(0)),__Buffer_434.concat([t.toArrayLike(__Buffer_434,"be",32),r.toArrayLike(__Buffer_434,"be",32)])},_$elliptic_434.sign=function(e,t,r,i){if("function"==typeof r){var n=r;r=function(r){var o=n(e,t,null,i,r);if(!__Buffer_434.isBuffer(o)||32!==o.length)throw new Error(_$messages_436.ECDSA_SIGN_FAIL);return new _$bn_214(o)}}var o=new _$bn_214(t);if(o.cmp(ecparams.n)>=0||o.isZero())throw new Error(_$messages_436.ECDSA_SIGN_FAIL);var a=ec.sign(e,t,{canonical:!0,k:r,pers:i});return{signature:__Buffer_434.concat([a.r.toArrayLike(__Buffer_434,"be",32),a.s.toArrayLike(__Buffer_434,"be",32)]),recovery:a.recoveryParam}},_$elliptic_434.verify=function(e,t,r){var i={r:t.slice(0,32),s:t.slice(32,64)},n=new _$bn_214(i.r),o=new _$bn_214(i.s);if(n.cmp(ecparams.n)>=0||o.cmp(ecparams.n)>=0)throw new Error(_$messages_436.ECDSA_SIGNATURE_PARSE_FAIL);if(1===o.cmp(ec.nh)||n.isZero()||o.isZero())return!1;var a=loadPublicKey(r);if(null===a)throw new Error(_$messages_436.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(e,i,{x:a.pub.x,y:a.pub.y})},_$elliptic_434.recover=function(e,t,r,i){var n={r:t.slice(0,32),s:t.slice(32,64)},o=new _$bn_214(n.r),a=new _$bn_214(n.s);if(o.cmp(ecparams.n)>=0||a.cmp(ecparams.n)>=0)throw new Error(_$messages_436.ECDSA_SIGNATURE_PARSE_FAIL);try{if(o.isZero()||a.isZero())throw new Error;var s=ec.recoverPubKey(e,n,r);return __Buffer_434.from(s.encode(!0,i))}catch(c){throw new Error(_$messages_436.ECDSA_RECOVER_FAIL)}},_$elliptic_434.ecdh=function(e,t){var r=_$elliptic_434.ecdhUnsafe(e,t,!0);return _$browser_276("sha256").update(r).digest()},_$elliptic_434.ecdhUnsafe=function(e,t,r){var i=loadPublicKey(e);if(null===i)throw new Error(_$messages_436.EC_PUBLIC_KEY_PARSE_FAIL);var n=new _$bn_214(t);if(n.cmp(ecparams.n)>=0||n.isZero())throw new Error(_$messages_436.ECDH_FAIL);return __Buffer_434.from(i.pub.mul(n).encode(!0,r))};var _$elliptic_431=_$lib_435(_$elliptic_434),_$bitcoinjsMessage_213={};(function(e){(function(){function t(e){return _$browser_276("sha256").update(e).digest()}function r(r,i){i=i||"\x18Bitcoin Signed Message:\n",e.isBuffer(i)||(i=e.from(i,"utf8"));var n=_$varuintBitcoin_474.encodingLength(r.length),o=e.allocUnsafe(i.length+n+r.length);return i.copy(o,0),_$varuintBitcoin_474.encode(r.length,o,i.length),o.write(r,i.length+n),function(e){return t(t(e))}(o)}_$bitcoinjsMessage_213={sign:function(t,i,n,o){var a=r(t,o),s=_$elliptic_431.sign(a,i);return function(t,r,i){return i&&(r+=4),e.concat([e.alloc(1,r+27),t])}(s.signature,s.recovery,n)},verify:function(i,n,o,a){e.isBuffer(o)||(o=e.from(o,"base64"));var s,c=function(e){if(65!==e.length)throw new Error("Invalid signature length");var t=e.readUInt8(0)-27;if(t>7)throw new Error("Invalid signature parameter");return{compressed:!!(4&t),recovery:3&t,signature:e.slice(1)}}(o),u=r(i,a),f=(s=_$elliptic_431.recover(u,c.signature,c.recovery,c.compressed),_$browser_276("ripemd160").update(t(s)).digest()),h=_$bs58check_263.decode(n).slice(1);return _$bufferEquals_264(f,h)}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$shams_356=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0},origSymbol="undefined"!=typeof Symbol&&Symbol,_$hasSymbols_355=function(){return"function"==typeof origSymbol&&"function"==typeof Symbol&&"symbol"==typeof origSymbol("foo")&&"symbol"==typeof Symbol("bar")&&_$shams_356()},slice=Array.prototype.slice,toStr=Object.prototype.toString,_$implementation_352=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==toStr.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,i=slice.call(arguments,1),n=Math.max(0,t.length-i.length),o=[],a=0;a1&&"boolean"!=typeof t)throw new $TypeError('"allowMissing" argument must be a boolean');var r=function(e){var t=$strSlice(e,0,1),r=$strSlice(e,-1);if("%"===t&&"%"!==r)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var i=[];return $replace(e,rePropName,(function(e,t,r,n){i[i.length]=r?$replace(n,reEscapeChar,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",n=getBaseIntrinsic("%"+i+"%",t),o=n.name,a=n.value,s=!1,c=n.alias;c&&(i=c[0],$spliceApply(r,$concat([0,1],c)));for(var u=1,f=!0;u=r.length){var d=$gOPD(a,h);a=(f=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[h]}else f=_$src_357(a,h),a=a[h];f&&!s&&(INTRINSICS[o]=a)}}return a},_$callBind_269={},$apply=_$getIntrinsic_354("%Function.prototype.apply%"),$call=_$getIntrinsic_354("%Function.prototype.call%"),$reflectApply=_$getIntrinsic_354("%Reflect.apply%",!0)||_$functionBind_353.call($call,$apply),__$gOPD_269=_$getIntrinsic_354("%Object.getOwnPropertyDescriptor%",!0),$defineProperty=_$getIntrinsic_354("%Object.defineProperty%",!0),$max=_$getIntrinsic_354("%Math.max%");if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=null}_$callBind_269=function(e){var t=$reflectApply(_$functionBind_353,$call,arguments);return __$gOPD_269&&$defineProperty&&__$gOPD_269(t,"length").configurable&&$defineProperty(t,"length",{value:1+$max(0,e.length-(arguments.length-1))}),t};var applyBind=function(){return $reflectApply(_$functionBind_353,$apply,arguments)};$defineProperty?$defineProperty(_$callBind_269,"apply",{value:applyBind}):_$callBind_269.apply=applyBind;var $indexOf=_$callBind_269(_$getIntrinsic_354("String.prototype.indexOf")),_$callBound_268=function(e,t){var r=_$getIntrinsic_354(e,!!t);return"function"==typeof r&&$indexOf(e,".prototype.")>-1?_$callBind_269(r):r},hasMap="function"==typeof Map&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap&&mapSizeDescriptor&&"function"==typeof mapSizeDescriptor.get?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet="function"==typeof Set&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&"function"==typeof setSizeDescriptor.get?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,weakMapHas="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,weakSetHas="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,weakRefDeref="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,match=String.prototype.match,bigIntValueOf="function"==typeof BigInt?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,hasShammedSymbols="function"==typeof Symbol&&"object"==typeof Symbol.iterator,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),inspectCustom=_$empty_216({}).custom,inspectSymbol=inspectCustom&&isSymbol(inspectCustom)?inspectCustom:null,toStringTag="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function wrapQuotes(e,t,r){var i="double"===(r.quoteStyle||t)?'"':"'";return i+e+i}function quote(e){return String(e).replace(/"/g,""")}function isArray(e){return!("[object Array]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(e){}return!1}var _$inspect__396=function t(r,i,n,o){var a=i||{};if(has(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!has(a,"customInspect")||a.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return function e(t,r){if(t.length>r.maxStringLength){var i=t.length-r.maxStringLength,n="... "+i+" more character"+(i>1?"s":"");return e(t.slice(0,r.maxStringLength),r)+n}return wrapQuotes(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,lowbyte),"single",r)}(r,a);if("number"==typeof r)return 0===r?1/0/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var c=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=c&&c>0&&"object"==typeof r)return isArray(r)?"[Array]":"[Object]";var u=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(a,n);if(void 0===o)o=[];else if(indexOf(o,r)>=0)return"[Circular]";function f(e,r,i){if(r&&(o=o.slice()).push(r),i){var s={depth:a.depth};return has(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,o)}return t(e,a,n+1,o)}if("function"==typeof r){var h=function(e){if(e.name)return e.name;var t=match.call(functionToString.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(r),l=arrObjKeys(r,f);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(isSymbol(r)){var _=hasShammedSymbols?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(r);return"object"!=typeof r||hasShammedSymbols?_:markBoxed(_)}if(function(e){return!(!e||"object"!=typeof e)&&("undefined"!=typeof HTMLElement&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(r)){for(var d="<"+String(r.nodeName).toLowerCase(),p=r.attributes||[],m=0;m"}if(isArray(r)){if(0===r.length)return"[]";var b=arrObjKeys(r,f);return u&&!function(e){for(var t=0;t=0)return!1;return!0}(b)?"["+indentedJoin(b,u)+"]":"[ "+b.join(", ")+" ]"}if(function(e){return!("[object Error]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r)){var g=arrObjKeys(r,f);return 0===g.length?"["+String(r)+"]":"{ ["+String(r)+"] "+g.join(", ")+" }"}if("object"==typeof r&&s){if(inspectSymbol&&"function"==typeof r[inspectSymbol])return r[inspectSymbol]();if("symbol"!==s&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!mapSize||!t||"object"!=typeof t)return!1;try{mapSize.call(t);try{setSize.call(t)}catch(d){return!0}return t instanceof Map}catch(e){}return!1}(r)){var y=[];return mapForEach.call(r,(function(e,t){y.push(f(t,r,!0)+" => "+f(e,r))})),collectionOf("Map",mapSize.call(r),y,u)}if(function(t){if(!setSize||!t||"object"!=typeof t)return!1;try{setSize.call(t);try{mapSize.call(t)}catch(r){return!0}return t instanceof Set}catch(e){}return!1}(r)){var v=[];return setForEach.call(r,(function(e){v.push(f(e,r))})),collectionOf("Set",setSize.call(r),v,u)}if(function(t){if(!weakMapHas||!t||"object"!=typeof t)return!1;try{weakMapHas.call(t,weakMapHas);try{weakSetHas.call(t,weakSetHas)}catch(d){return!0}return t instanceof WeakMap}catch(e){}return!1}(r))return weakCollectionOf("WeakMap");if(function(t){if(!weakSetHas||!t||"object"!=typeof t)return!1;try{weakSetHas.call(t,weakSetHas);try{weakMapHas.call(t,weakMapHas)}catch(d){return!0}return t instanceof WeakSet}catch(e){}return!1}(r))return weakCollectionOf("WeakSet");if(function(t){if(!weakRefDeref||!t||"object"!=typeof t)return!1;try{return weakRefDeref.call(t),!0}catch(e){}return!1}(r))return weakCollectionOf("WeakRef");if(function(e){return!("[object Number]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r))return markBoxed(f(Number(r)));if(function(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(e){}return!1}(r))return markBoxed(f(bigIntValueOf.call(r)));if(function(e){return!("[object Boolean]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r))return markBoxed(booleanValueOf.call(r));if(function(e){return!("[object String]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r))return markBoxed(f(String(r)));if(!function(e){return!("[object Date]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r)&&!function(e){return!("[object RegExp]"!==__toStr_396(e)||toStringTag&&"object"==typeof e&&toStringTag in e)}(r)){var w=arrObjKeys(r,f),$=gPO?gPO(r)===Object.prototype:r instanceof Object||r.constructor===Object,E=r instanceof Object?"":"null prototype",S=!$&&toStringTag&&Object(r)===r&&toStringTag in r?__toStr_396(r).slice(8,-1):E?"Object":"",A=($||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(S||E?"["+[].concat(S||[],E||[]).join(": ")+"] ":"");return 0===w.length?A+"{}":u?A+"{"+indentedJoin(w,u)+"}":A+"{ "+w.join(", ")+" }"}return String(r)},__hasOwn_396=Object.prototype.hasOwnProperty||function(e){return e in this};function has(e,t){return __hasOwn_396.call(e,t)}function __toStr_396(e){return objectToString.call(e)}function indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r1;){var t=e.pop(),r=t.obj[t.prop];if(__isArray_419(r)){for(var i=[],n=0;n=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||n===_$formats_415.RFC1738&&(40===c||41===c)?a+=o.charAt(s):c<128?a+=hexTable[c]:c<2048?a+=hexTable[192|c>>6]+hexTable[128|63&c]:c<55296||c>=57344?a+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(s+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(s)),a+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return a},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(__isArray_419(e)){for(var r=[],i=0;i0?b.join(",")||null:void 0}];else if(__isArray_418(s))g=s;else{var v=Object.keys(b);g=c?v.sort(c):v}for(var w=0;w0?l+h:""},__has_417=Object.prototype.hasOwnProperty,__isArray_417=Array.isArray,__defaults_417={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_$utils_419.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},parseArrayValue=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},parseKeys=function(e,t,r,i){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),s=a?n.slice(0,a.index):n,c=[];if(s){if(!r.plainObjects&&__has_417.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;r.depth>0&&null!==(a=o.exec(n))&&u=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=n:a[c]=n:a={0:n}}n=a}return n}(c,t,r,i)}},_$parse_417=function(e,t){var r=function(e){if(!e)return __defaults_417;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?__defaults_417.charset:e.charset;return{allowDots:void 0===e.allowDots?__defaults_417.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:__defaults_417.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:__defaults_417.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:__defaults_417.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:__defaults_417.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:__defaults_417.comma,decoder:"function"==typeof e.decoder?e.decoder:__defaults_417.decoder,delimiter:"string"==typeof e.delimiter||_$utils_419.isRegExp(e.delimiter)?e.delimiter:__defaults_417.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:__defaults_417.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:__defaults_417.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:__defaults_417.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:__defaults_417.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:__defaults_417.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var i="string"==typeof e?function(e,t){var r,i={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,a=n.split(t.delimiter,o),s=-1,c=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(f=__isArray_417(f)?[f]:f),__has_417.call(i,u)?i[u]=_$utils_419.combine(i[u],f):i[u]=f}return i}(e,r):e,n=r.plainObjects?Object.create(null):{},o=Object.keys(i),a=0;a>o%8,e._prev=shiftIn(e._prev,r?i:n);return a}function shiftIn(e,t){var r=e.length,i=-1,n=__Buffer_226.allocUnsafe(e.length);for(e=__Buffer_226.concat([e,__Buffer_226.from([t])]);++i>7;return n}_$cfb1_226.encrypt=function(e,t,r){for(var i=t.length,n=__Buffer_226.allocUnsafe(i),o=-1;++o>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&m]^t[b++],a=u[d>>>24]^f[p>>>16&255]^h[m>>>8&255]^l[255&_]^t[b++],s=u[p>>>24]^f[m>>>16&255]^h[_>>>8&255]^l[255&d]^t[b++],c=u[m>>>24]^f[_>>>16&255]^h[d>>>8&255]^l[255&p]^t[b++],_=o,d=a,p=s,m=c;return o=(i[_>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^t[b++],a=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&_])^t[b++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[_>>>8&255]<<8|i[255&d])^t[b++],c=(i[m>>>24]<<24|i[_>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,i[u]=a;var f=e[a],h=e[f],l=e[h],_=257*e[u]^16843008*u;n[0][a]=_<<24|_>>>8,n[1][a]=_<<16|_>>>16,n[2][a]=_<<8|_>>>24,n[3][a]=_,_=16843009*l^65537*h^257*f^16843008*a,o[0][u]=_<<24|_>>>8,o[1][u]=_<<16|_>>>16,o[2][u]=_<<8|_>>>24,o[3][u]=_,0===a?a=s=1:(a=f^e[e[e[l^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function AES(e){this._key=asUInt32Array(e),this._reset()}AES.blockSize=16,AES.keySize=32,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=G.SBOX[a>>>24]<<24|G.SBOX[a>>>16&255]<<16|G.SBOX[a>>>8&255]<<8|G.SBOX[255&a],a^=RCON[o/t|0]<<24):t>6&&o%t==4&&(a=G.SBOX[a>>>24]<<24|G.SBOX[a>>>16&255]<<16|G.SBOX[a>>>8&255]<<8|G.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],c=0;c>>24]]^G.INV_SUB_MIX[1][G.SBOX[f>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[f>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},AES.prototype.encryptBlockRaw=function(e){return cryptBlock(e=asUInt32Array(e),this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=__Buffer_217.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},AES.prototype.decryptBlock=function(e){var t=(e=asUInt32Array(e))[1];e[1]=e[3],e[3]=t;var r=cryptBlock(e,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),i=__Buffer_217.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},_$aes_217.AES=AES;var _$ghash_222={},__Buffer_222=_$safeBuffer_424.Buffer,ZEROES=__Buffer_222.alloc(16,0);function fromArray(e){var t=__Buffer_222.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function GHASH(e){this.h=e,this.state=__Buffer_222.alloc(16,0),this.cache=__Buffer_222.allocUnsafe(0)}GHASH.prototype.ghash=function(e){for(var t=-1;++t0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=fromArray(n)},GHASH.prototype.update=function(e){var t;for(this.cache=__Buffer_222.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},GHASH.prototype.final=function(e,t){return this.cache.length&&this.ghash(__Buffer_222.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,e,0,t])),this.state},_$ghash_222=GHASH;var _$authCipher_218={},__Buffer_218=_$safeBuffer_424.Buffer;function StreamCipher(e,t,r,i){_$cipherBase_274.call(this);var n=__Buffer_218.alloc(4,0);this._cipher=new _$aes_217.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new _$ghash_222(o),r=function(e,t,r){if(12===t.length)return e._finID=__Buffer_218.concat([t,__Buffer_218.from([0,0,0,1])]),__Buffer_218.concat([t,__Buffer_218.from([0,0,0,2])]);var i=new _$ghash_222(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(__Buffer_218.alloc(o,0))),i.update(__Buffer_218.alloc(8,0));var a=8*n,s=__Buffer_218.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var c=__Buffer_218.from(e._finID);return _$incr32_223(c),c}(this,r,o),this._prev=__Buffer_218.from(r),this._cache=__Buffer_218.allocUnsafe(0),this._secCache=__Buffer_218.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}_$inherits_browser_388(StreamCipher,_$cipherBase_274),StreamCipher.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=__Buffer_218.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},StreamCipher.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=_$bufferXor_265(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n0||i>0;){var c=new _$md5Js_391;c.update(s),c.update(e),t&&c.update(t),s=c.digest();var u=0;if(n>0){var f=o.length-n;u=Math.min(n,s.length),s.copy(o,f,0,u),n-=u}if(u0){var h=a.length-i,l=Math.min(i,s.length-u);s.copy(a,h,u,u+l),i-=l}}return s.fill(0),{key:o,iv:a}},_$encrypter_221={},__Buffer_221=_$safeBuffer_424.Buffer;function Cipher(e,t,r){_$cipherBase_274.call(this),this._cache=new Splitter,this._cipher=new _$aes_217.AES(t),this._prev=__Buffer_221.from(r),this._mode=e,this._autopadding=!0}_$inherits_browser_388(Cipher,_$cipherBase_274),Cipher.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return __Buffer_221.concat(i)};var PADDING=__Buffer_221.alloc(16,16);function Splitter(){this.cache=__Buffer_221.allocUnsafe(0)}function createCipheriv(e,t,r){var i=_$modes_230[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=__Buffer_221.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=__Buffer_221.from(r)),"GCM"!==i.mode&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===i.type?new _$streamCipher_233(i.module,t,r):"auth"===i.type?new _$authCipher_218(i.module,t,r):new Cipher(i.module,t,r)}Cipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},Splitter.prototype.add=function(e){this.cache=__Buffer_221.concat([this.cache,e])},Splitter.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},Splitter.prototype.flush=function(){for(var e=16-this.cache.length,t=__Buffer_221.allocUnsafe(e),r=-1;++r16)throw new Error("unable to decrypt data");for(var r=-1;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},__Splitter_220.prototype.flush=function(){if(this.cache.length)return this.cache};var _$browser_219={};_$encrypter_221.createCipher,_$browser_219.createCipheriv=_$encrypter_221.createCipheriv,_$decrypter_220.createDecipher,_$browser_219.createDecipheriv=_$decrypter_220.createDecipheriv,_$browser_219.getCiphers=function(){return Object.keys(_$list_231)};var _$algorithms_240={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},_$algos_239=_$algorithms_240,MAX_ALLOC=Math.pow(2,30)-1,_$precondition_405=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>MAX_ALLOC||t!=t)throw new TypeError("Bad key length")},_$defaultEncoding_404={};(function(e,t){(function(){var r;r=t.process&&t.process.browser?"utf-8":t.process&&t.process.version?parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",_$defaultEncoding_404=r}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var __Buffer_407=_$safeBuffer_424.Buffer,_$toBuffer_407=function(e,t,r){if(__Buffer_407.isBuffer(e))return e;if("string"==typeof e)return __Buffer_407.from(e,t);if(ArrayBuffer.isView(e))return __Buffer_407.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")},_$syncBrowser_406={},__Buffer_406=_$safeBuffer_424.Buffer,__ZEROS_406=__Buffer_406.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function __Hmac_406(e,t,r){var i=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new _$ripemd160_423).update(e).digest()}:"md5"===e?_$md5_277:function(t){return _$shaJs_438(e).update(t).digest()}}(e),n="sha512"===e||"sha384"===e?128:64;t.length>n?t=i(t):t.length>>0},writeUInt32BE:function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},ip:function(e,t,r,i){for(var n=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},rip:function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},pc1:function(e,t,r,i){for(var n=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r28shl:function(e,t){return e<>>28-t}},pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];_$utils_320.pc2=function(e,t,r,i){for(var n=0,o=0,a=pc2table.length>>>1,s=0;s>>pc2table[s]&1;for(s=a;s>>pc2table[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},_$utils_320.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=e>>>o&63;for(o=11;o>=3;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];_$utils_320.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r<<=4,r|=sTable[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=sTable[256+64*i+(t>>>18-6*i&63)];return r>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];_$utils_320.permute=function(e){for(var t=0,r=0;r>>permuteTable[r]&1;return t>>>0},_$utils_320.padSplit=function(e,t,r){for(var i=e.toString(2);i.length0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},__Cipher_317.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},__Cipher_317.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=_$utils_320.r28shl(r,o),i=_$utils_320.r28shl(i,o),_$utils_320.pc2(r,i,e.keys,n)}},DES.prototype._update=function(e,t,r,i){var n=this._desState,o=_$utils_320.readUInt32BE(e,t),a=_$utils_320.readUInt32BE(e,t+4);_$utils_320.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],_$utils_320.writeUInt32BE(r,o,i),_$utils_320.writeUInt32BE(r,a,i+4)},DES.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=h}_$utils_320.rip(a,o,i,n)},DES.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;s>=0;s-=2){var c=e.keys[s],u=e.keys[s+1];_$utils_320.expand(o,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=_$utils_320.substitute(c,u),h=o;o=(a^_$utils_320.permute(f))>>>0,a=h}_$utils_320.rip(o,a,i,n)};var _$cbc_316={},__proto_316={};function CBCState(e){this.iv=new Array(8);for(var t=0;t=0);return i},MillerRabin.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},MillerRabin.prototype.test=function(e,t,r){var i=e.bitLength(),n=_$bn_214.mont(e),o=new _$bn_214(1).toRed(n);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var c=e.shrn(s),u=a.toRed(n);t>0;t--){var f=this._randrange(new _$bn_214(2),a);r&&r(f);var h=f.toRed(n).redPow(c);if(0!==h.cmp(o)&&0!==h.cmp(u)){for(var l=1;l0;t--){var u=this._randrange(new _$bn_214(2),o),f=e.gcd(u);if(0!==f.cmpn(1))return f;var h=u.toRed(i).redPow(s);if(0!==h.cmp(n)&&0!==h.cmp(c)){for(var l=1;le;)r.ishrn(1);if(r.isEven()&&r.iadd(__ONE_323),r.testn(1)||r.iadd(TWO),t.cmp(TWO)){if(!t.cmp(FIVE))for(;r.mod(TEN).cmp(__THREE_323);)r.iadd(FOUR)}else for(;r.mod(TWENTYFOUR).cmp(ELEVEN);)r.iadd(FOUR);if(simpleSieve(i=r.shrn(1))&&simpleSieve(r)&&fermatTest(i)&&fermatTest(r)&&millerRabin.test(i)&&millerRabin.test(r))return r}}var _$primes_324={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},_$DH_322={};(function(e){(function(){var t=new _$mr_393,r=new _$bn_214(24),i=new _$bn_214(11),n=new _$bn_214(10),o=new _$bn_214(3),a=new _$bn_214(7);function s(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new _$bn_214(t),this}function c(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new _$bn_214(t),this}_$DH_322=f;var u={};function f(e,t,r){this.setGenerator(t),this.__prime=new _$bn_214(e),this._prime=_$bn_214.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=s,this.setPrivateKey=c):this._primeCode=8}function h(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(f.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,s){var c=s.toString("hex"),f=[c,e.toString(16)].join("_");if(f in u)return u[f];var h,l=0;if(e.isEven()||!_$generatePrime_323.simpleSieve||!_$generatePrime_323.fermatTest(e)||!t.test(e))return l+=1,l+="02"===c||"05"===c?8:4,u[f]=l,l;switch(t.test(e.shrn(1))||(l+=2),c){case"02":e.mod(r).cmp(i)&&(l+=8);break;case"05":(h=e.mod(n)).cmp(o)&&h.cmp(a)&&(l+=8);break;default:l+=4}return u[f]=l,l}(this.__prime,this.__gen)),this._primeCode}}),f.prototype.generateKeys=function(){return this._priv||(this._priv=new _$bn_214(_$browser_421(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},f.prototype.computeSecret=function(t){var r=(t=(t=new _$bn_214(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new e(r.toArray()),n=this.getPrime();if(i.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return __Buffer_253.alloc(0);for(var t,r,i,n=__Buffer_253.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=n,i=a,__Buffer_253.prototype.copy.call(t,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0==(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=__Buffer_253.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t}},{key:__custom_253,value:function(e,t){return __inspect_253(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}__createErrorType_246("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),__createErrorType_246("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,n,o,a;if("string"==typeof t&&("not ","not "===t.substr(0,"not ".length))?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=e,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(e," ").concat(i," ").concat(__oneOf_246(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";n='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(__oneOf_246(t,"type"))}return n+". Received type ".concat(typeof r)}),TypeError),__createErrorType_246("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),__createErrorType_246("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),__createErrorType_246("ERR_STREAM_PREMATURE_CLOSE","Premature close"),__createErrorType_246("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),__createErrorType_246("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),__createErrorType_246("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),__createErrorType_246("ERR_STREAM_WRITE_AFTER_END","write after end"),__createErrorType_246("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),__createErrorType_246("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),__createErrorType_246("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_$errorsBrowser_246.codes=__codes_246;var __ERR_INVALID_OPT_VALUE_258=_$errorsBrowser_246.codes.ERR_INVALID_OPT_VALUE,_$state_258={getHighWaterMark:function(e,t,r,i){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new __ERR_INVALID_OPT_VALUE_258(i?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}},_$Transform_250=__Transform_250,___require$codes_250=_$errorsBrowser_246.codes,__ERR_METHOD_NOT_IMPLEMENTED_250=___require$codes_250.ERR_METHOD_NOT_IMPLEMENTED,__ERR_MULTIPLE_CALLBACK_250=___require$codes_250.ERR_MULTIPLE_CALLBACK,__ERR_TRANSFORM_ALREADY_TRANSFORMING_250=___require$codes_250.ERR_TRANSFORM_ALREADY_TRANSFORMING,__ERR_TRANSFORM_WITH_LENGTH_0_250=___require$codes_250.ERR_TRANSFORM_WITH_LENGTH_0,__Duplex_250=_$Duplex_247({});function __afterTransform_250(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new __ERR_MULTIPLE_CALLBACK_250);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length0,(function(e){i||(i=e),e&&o.forEach(__call_257),a||(o.forEach(__call_257),n(i))}))}));return t.reduce(__pipe_257)},_$readableBrowser_260={};_$readableBrowser_260=_$readableBrowser_260=_$_stream_readable_249({}),_$readableBrowser_260.Stream=_$readableBrowser_260,_$readableBrowser_260.Readable=_$readableBrowser_260,_$readableBrowser_260.Writable=_$_stream_writable_251({}),_$readableBrowser_260.Duplex=_$Duplex_247({}),_$readableBrowser_260.Transform=_$Transform_250,_$readableBrowser_260.PassThrough=_$PassThrough_248,_$readableBrowser_260.finished=_$eos_255({}),_$readableBrowser_260.pipeline=_$pipeline_257;var _$bn_238={exports:{}};!function(t,r){"use strict";function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.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"))}var o;"object"==typeof t?t.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:_$empty_216({}).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void 0}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return n}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.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);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(i=0,n=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=s(e,t,i)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,l=Math.min(u,t.length-1),_=Math.max(0,u-e.length+1);_<=l;_++){var d=u-_|0;f+=(a=(n=0|e.words[d])*(o=0|t.words[_])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,(i+=2)>=26&&(i-=26,o--)}for(0!==n&&(r=n.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=l[e],u=_[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modrn(u).toString(e);r=(f=f.idivn(u)).isZero()?d+r:h[c-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}},n.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,0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),n=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,r||Math.max(1,i));return this["_toArrayLike"+("le"===t?"LE":"BE")](n,i),n},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=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},n.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},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.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)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){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()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){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,i=e):(r=e,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},n.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,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,_=0|a[1],d=8191&_,p=_>>>13,m=0|a[2],b=8191&m,g=m>>>13,y=0|a[3],v=8191&y,w=y>>>13,$=0|a[4],E=8191&$,S=$>>>13,A=0|a[5],B=8191&A,k=A>>>13,M=0|a[6],T=8191&M,R=M>>>13,I=0|a[7],P=8191&I,x=I>>>13,O=0|a[8],C=8191&O,N=O>>>13,L=0|a[9],D=8191&L,U=L>>>13,H=0|s[0],j=8191&H,z=H>>>13,q=0|s[1],K=8191&q,F=q>>>13,G=0|s[2],V=8191&G,W=G>>>13,Y=0|s[3],J=8191&Y,X=Y>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,le=fe>>>13,_e=0|s[9],de=8191&_e,pe=_e>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(i=Math.imul(h,j))|0)+((8191&(n=(n=Math.imul(h,z))+Math.imul(l,j)|0))<<13)|0;u=((o=Math.imul(l,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,j),n=(n=Math.imul(d,z))+Math.imul(p,j)|0,o=Math.imul(p,z);var be=(u+(i=i+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,F)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,F)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,z))+Math.imul(g,j)|0,o=Math.imul(g,z),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,F)|0)+Math.imul(p,K)|0,o=o+Math.imul(p,F)|0;var ge=(u+(i=i+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,V)|0))<<13)|0;u=((o=o+Math.imul(l,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(v,j),n=(n=Math.imul(v,z))+Math.imul(w,j)|0,o=Math.imul(w,z),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,F)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,F)|0,i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,W)|0;var ye=(u+(i=i+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(l,J)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,z))+Math.imul(S,j)|0,o=Math.imul(S,z),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,F)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,F)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,W)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(p,J)|0,o=o+Math.imul(p,X)|0;var ve=(u+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(B,j),n=(n=Math.imul(B,z))+Math.imul(k,j)|0,o=Math.imul(k,z),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,F)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,F)|0,i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,W)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,ee)|0;var we=(u+(i=i+Math.imul(h,re)|0)|0)+((8191&(n=(n=n+Math.imul(h,ie)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,z))+Math.imul(R,j)|0,o=Math.imul(R,z),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,F)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,F)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,i=i+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ie)|0;var $e=(u+(i=i+Math.imul(h,oe)|0)|0)+((8191&(n=(n=n+Math.imul(h,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(n>>>13)|0)+($e>>>26)|0,$e&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,z))+Math.imul(x,j)|0,o=Math.imul(x,z),i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,F)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,F)|0,i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(E,J)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Ee=(u+(i=i+Math.imul(h,ce)|0)|0)+((8191&(n=(n=n+Math.imul(h,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,j),n=(n=Math.imul(C,z))+Math.imul(N,j)|0,o=Math.imul(N,z),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,F)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,F)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(B,J)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,ue)|0;var Se=(u+(i=i+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,j),n=(n=Math.imul(D,z))+Math.imul(U,j)|0,o=Math.imul(U,z),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,F)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,F)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(v,oe)|0,n=(n=n+Math.imul(v,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,ue)|0,i=i+Math.imul(d,he)|0,n=(n=n+Math.imul(d,le)|0)+Math.imul(p,he)|0,o=o+Math.imul(p,le)|0;var Ae=(u+(i=i+Math.imul(h,de)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,F))+Math.imul(U,K)|0,o=Math.imul(U,F),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,W)|0,i=i+Math.imul(P,J)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,i=i+Math.imul(b,he)|0,n=(n=n+Math.imul(b,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Be=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;u=((o=o+Math.imul(p,pe)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,W))+Math.imul(U,V)|0,o=Math.imul(U,W),i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(B,oe)|0,n=(n=n+Math.imul(B,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,i=i+Math.imul(v,he)|0,n=(n=n+Math.imul(v,le)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,le)|0;var ke=(u+(i=i+Math.imul(b,de)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(g,de)|0))<<13)|0;u=((o=o+Math.imul(g,pe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,J),n=(n=Math.imul(D,X))+Math.imul(U,J)|0,o=Math.imul(U,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,i=i+Math.imul(E,he)|0,n=(n=n+Math.imul(E,le)|0)+Math.imul(S,he)|0,o=o+Math.imul(S,le)|0;var Me=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,pe)|0)+Math.imul(w,de)|0))<<13)|0;u=((o=o+Math.imul(w,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,i=i+Math.imul(T,ce)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,i=i+Math.imul(B,he)|0,n=(n=n+Math.imul(B,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var Te=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,de)|0))<<13)|0;u=((o=o+Math.imul(S,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,i=i+Math.imul(T,he)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Re=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,pe)|0)+Math.imul(k,de)|0))<<13)|0;u=((o=o+Math.imul(k,pe)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,oe),n=(n=Math.imul(D,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,i=i+Math.imul(P,he)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Ie=(u+(i=i+Math.imul(T,de)|0)|0)+((8191&(n=(n=n+Math.imul(T,pe)|0)+Math.imul(R,de)|0))<<13)|0;u=((o=o+Math.imul(R,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),i=i+Math.imul(C,he)|0,n=(n=n+Math.imul(C,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Pe=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,pe)|0)+Math.imul(x,de)|0))<<13)|0;u=((o=o+Math.imul(x,pe)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,he),n=(n=Math.imul(D,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(u+(i=i+Math.imul(C,de)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(N,de)|0))<<13)|0;u=((o=o+Math.imul(N,pe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Oe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,pe))+Math.imul(U,de)|0))<<13)|0;return u=((o=Math.imul(U,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=be,c[2]=ge,c[3]=ye,c[4]=ve,c[5]=we,c[6]=$e,c[7]=Ee,c[8]=Se,c[9]=Ae,c[10]=Be,c[11]=ke,c[12]=Me,c[13]=Te,c[14]=Re,c[15]=Ie,c[16]=Pe,c[17]=xe,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function b(e,t,r){return m(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?m(this,e,t):b(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},g.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,r+=n/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i>>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>>n<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-n|f>>>n,u=f&a}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,r){return this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){var t=e%26,r=(e-t)/26,i=1<>>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},n.prototype.isubn=function(e){if(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)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this._strip();for(a=0,i=0;i>26,this.words[i]=67108863&n;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),i.iushln(r),a=0|o.words[o.length-1]);var s,c=i.length-o.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|i.words[o.length+h])+(0|i.words[o.length+h-1]);for(l=Math.min(l/a|0,67108863),i._ishlnsubmul(o,l,h);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(o,1,h),i.isZero()||(i.negative^=1);s&&(s.words[h]=l)}return s&&s._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},n.prototype.divmod=function(e,t,r){return this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.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,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e);for(var r=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(r*i+(0|this.words[n]))%e;return t?-i:i},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e);for(var r=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*r;this.words[i]=n/e|0,r=n%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new n(1),o=new n(0),a=new n(0),s=new n(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var _=0,d=1;0==(r.words[0]&d)&&_<26;++_,d<<=1);if(_>0)for(r.iushrn(_);_-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(f)),a.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),o.isub(s)):(r.isub(t),a.isub(i),s.isub(o))}return{a:a,b:s,gcd:r.iushln(c)}},n.prototype._invmp=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new n(1),a=new n(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(i=0===t.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(e),i},n.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 i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new A(e)},n.prototype.toRed=function(e){return e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return this._forceRed(e)},n.prototype.redAdd=function(e){return this.red.add(this,e)},n.prototype.redIAdd=function(e){return this.red.iadd(this,e)},n.prototype.redSub=function(e){return this.red.sub(this,e)},n.prototype.redISub=function(e){return this.red.isub(this,e)},n.prototype.redShl=function(e){return this.red.shl(this,e)},n.prototype.redMul=function(e){return this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function $(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function B(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(w,v),w.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=o}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},w.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]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new $;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},A.prototype._verify1=function(e){},A.prototype._verify2=function(e,t){},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.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)},A.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},A.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)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();if(3===this.m.andln(3)){var t=this.m.add(new n(1)).iushrn(2);return this.pow(e,t)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);var o=new n(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);0!==this.pow(c,s).cmp(a);)c.redIAdd(a);for(var u=this.pow(c,r),f=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=i;0!==h.cmp(o);){for(var _=h,d=0;0!==_.cmp(o);d++)_=_.redSqr();var p=this.pow(u,new n(1).iushln(l-d-1));f=f.redMul(p),u=p.redSqr(),h=h.redMul(u),l=d}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i=0;i--){for(var u=t.words[i],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===i&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new B(e)},i(B,A),B.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},B.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},B.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},B.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(_$bn_238,this),_$bn_238=_$bn_238.exports;var _$browserifyRsa_237={};(function(e){(function(){function t(e){var t,r=e.modulus.byteLength();do{t=new _$bn_238(_$browser_421(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function r(r,i){var n=function(e){var r=t(e);return{blinder:r.toRed(_$bn_238.mont(e.modulus)).redPow(new _$bn_238(e.publicExponent)).fromRed(),unblinder:r.invm(e.modulus)}}(i),o=i.modulus.byteLength(),a=new _$bn_238(r).mul(n.blinder).umod(i.modulus),s=a.toRed(_$bn_238.mont(i.prime1)),c=a.toRed(_$bn_238.mont(i.prime2)),u=i.coefficient,f=i.prime1,h=i.prime2,l=s.redPow(i.exponent1).fromRed(),_=c.redPow(i.exponent2).fromRed(),d=l.isub(_).imul(u).umod(f).imul(h);return _.iadd(d).imul(n.unblinder).umod(i.modulus).toArrayLike(e,"be",o)}r.getr=t,_$browserifyRsa_237=r}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$bn_245={exports:{}};!function(t,r){"use strict";function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.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"))}var o;"object"==typeof t?t.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:_$empty_216({}).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void 0}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return n}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.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);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(i=0,n=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=s(e,t,i)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,l=Math.min(u,t.length-1),_=Math.max(0,u-e.length+1);_<=l;_++){var d=u-_|0;f+=(a=(n=0|e.words[d])*(o=0|t.words[_])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,(i+=2)>=26&&(i-=26,o--)}for(0!==n&&(r=n.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=l[e],u=_[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modrn(u).toString(e);r=(f=f.idivn(u)).isZero()?d+r:h[c-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}},n.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,0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),n=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,r||Math.max(1,i));return this["_toArrayLike"+("le"===t?"LE":"BE")](n,i),n},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=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},n.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},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.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)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){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()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){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,i=e):(r=e,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},n.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,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,_=0|a[1],d=8191&_,p=_>>>13,m=0|a[2],b=8191&m,g=m>>>13,y=0|a[3],v=8191&y,w=y>>>13,$=0|a[4],E=8191&$,S=$>>>13,A=0|a[5],B=8191&A,k=A>>>13,M=0|a[6],T=8191&M,R=M>>>13,I=0|a[7],P=8191&I,x=I>>>13,O=0|a[8],C=8191&O,N=O>>>13,L=0|a[9],D=8191&L,U=L>>>13,H=0|s[0],j=8191&H,z=H>>>13,q=0|s[1],K=8191&q,F=q>>>13,G=0|s[2],V=8191&G,W=G>>>13,Y=0|s[3],J=8191&Y,X=Y>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,le=fe>>>13,_e=0|s[9],de=8191&_e,pe=_e>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(i=Math.imul(h,j))|0)+((8191&(n=(n=Math.imul(h,z))+Math.imul(l,j)|0))<<13)|0;u=((o=Math.imul(l,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,j),n=(n=Math.imul(d,z))+Math.imul(p,j)|0,o=Math.imul(p,z);var be=(u+(i=i+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,F)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,F)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,z))+Math.imul(g,j)|0,o=Math.imul(g,z),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,F)|0)+Math.imul(p,K)|0,o=o+Math.imul(p,F)|0;var ge=(u+(i=i+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,V)|0))<<13)|0;u=((o=o+Math.imul(l,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(v,j),n=(n=Math.imul(v,z))+Math.imul(w,j)|0,o=Math.imul(w,z),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,F)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,F)|0,i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,W)|0;var ye=(u+(i=i+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(l,J)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,z))+Math.imul(S,j)|0,o=Math.imul(S,z),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,F)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,F)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,W)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(p,J)|0,o=o+Math.imul(p,X)|0;var ve=(u+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(B,j),n=(n=Math.imul(B,z))+Math.imul(k,j)|0,o=Math.imul(k,z),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,F)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,F)|0,i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,W)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,ee)|0;var we=(u+(i=i+Math.imul(h,re)|0)|0)+((8191&(n=(n=n+Math.imul(h,ie)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,z))+Math.imul(R,j)|0,o=Math.imul(R,z),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,F)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,F)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,i=i+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ie)|0;var $e=(u+(i=i+Math.imul(h,oe)|0)|0)+((8191&(n=(n=n+Math.imul(h,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(n>>>13)|0)+($e>>>26)|0,$e&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,z))+Math.imul(x,j)|0,o=Math.imul(x,z),i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,F)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,F)|0,i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(E,J)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Ee=(u+(i=i+Math.imul(h,ce)|0)|0)+((8191&(n=(n=n+Math.imul(h,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,j),n=(n=Math.imul(C,z))+Math.imul(N,j)|0,o=Math.imul(N,z),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,F)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,F)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(B,J)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,ue)|0;var Se=(u+(i=i+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,j),n=(n=Math.imul(D,z))+Math.imul(U,j)|0,o=Math.imul(U,z),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,F)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,F)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(v,oe)|0,n=(n=n+Math.imul(v,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,ue)|0,i=i+Math.imul(d,he)|0,n=(n=n+Math.imul(d,le)|0)+Math.imul(p,he)|0,o=o+Math.imul(p,le)|0;var Ae=(u+(i=i+Math.imul(h,de)|0)|0)+((8191&(n=(n=n+Math.imul(h,pe)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,pe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,F))+Math.imul(U,K)|0,o=Math.imul(U,F),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,W)|0,i=i+Math.imul(P,J)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,i=i+Math.imul(b,he)|0,n=(n=n+Math.imul(b,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Be=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;u=((o=o+Math.imul(p,pe)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,W))+Math.imul(U,V)|0,o=Math.imul(U,W),i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(B,oe)|0,n=(n=n+Math.imul(B,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,i=i+Math.imul(v,he)|0,n=(n=n+Math.imul(v,le)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,le)|0;var ke=(u+(i=i+Math.imul(b,de)|0)|0)+((8191&(n=(n=n+Math.imul(b,pe)|0)+Math.imul(g,de)|0))<<13)|0;u=((o=o+Math.imul(g,pe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,J),n=(n=Math.imul(D,X))+Math.imul(U,J)|0,o=Math.imul(U,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,i=i+Math.imul(E,he)|0,n=(n=n+Math.imul(E,le)|0)+Math.imul(S,he)|0,o=o+Math.imul(S,le)|0;var Me=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,pe)|0)+Math.imul(w,de)|0))<<13)|0;u=((o=o+Math.imul(w,pe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,i=i+Math.imul(T,ce)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,i=i+Math.imul(B,he)|0,n=(n=n+Math.imul(B,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var Te=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,de)|0))<<13)|0;u=((o=o+Math.imul(S,pe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,i=i+Math.imul(T,he)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Re=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,pe)|0)+Math.imul(k,de)|0))<<13)|0;u=((o=o+Math.imul(k,pe)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,oe),n=(n=Math.imul(D,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,i=i+Math.imul(P,he)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Ie=(u+(i=i+Math.imul(T,de)|0)|0)+((8191&(n=(n=n+Math.imul(T,pe)|0)+Math.imul(R,de)|0))<<13)|0;u=((o=o+Math.imul(R,pe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),i=i+Math.imul(C,he)|0,n=(n=n+Math.imul(C,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Pe=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,pe)|0)+Math.imul(x,de)|0))<<13)|0;u=((o=o+Math.imul(x,pe)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,he),n=(n=Math.imul(D,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(u+(i=i+Math.imul(C,de)|0)|0)+((8191&(n=(n=n+Math.imul(C,pe)|0)+Math.imul(N,de)|0))<<13)|0;u=((o=o+Math.imul(N,pe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Oe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,pe))+Math.imul(U,de)|0))<<13)|0;return u=((o=Math.imul(U,pe))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=be,c[2]=ge,c[3]=ye,c[4]=ve,c[5]=we,c[6]=$e,c[7]=Ee,c[8]=Se,c[9]=Ae,c[10]=Be,c[11]=ke,c[12]=Me,c[13]=Te,c[14]=Re,c[15]=Ie,c[16]=Pe,c[17]=xe,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function b(e,t,r){return m(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?m(this,e,t):b(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},g.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,r+=n/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i>>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>>n<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-n|f>>>n,u=f&a}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,r){return this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){var t=e%26,r=(e-t)/26,i=1<>>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},n.prototype.isubn=function(e){if(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)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this._strip();for(a=0,i=0;i>26,this.words[i]=67108863&n;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),i.iushln(r),a=0|o.words[o.length-1]);var s,c=i.length-o.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|i.words[o.length+h])+(0|i.words[o.length+h-1]);for(l=Math.min(l/a|0,67108863),i._ishlnsubmul(o,l,h);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(o,1,h),i.isZero()||(i.negative^=1);s&&(s.words[h]=l)}return s&&s._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},n.prototype.divmod=function(e,t,r){return this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.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,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e);for(var r=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(r*i+(0|this.words[n]))%e;return t?-i:i},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e);for(var r=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*r;this.words[i]=n/e|0,r=n%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new n(1),o=new n(0),a=new n(0),s=new n(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var _=0,d=1;0==(r.words[0]&d)&&_<26;++_,d<<=1);if(_>0)for(r.iushrn(_);_-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(f)),a.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),o.isub(s)):(r.isub(t),a.isub(i),s.isub(o))}return{a:a,b:s,gcd:r.iushln(c)}},n.prototype._invmp=function(e){var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new n(1),a=new n(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(i=0===t.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(e),i},n.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 i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new A(e)},n.prototype.toRed=function(e){return e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return this._forceRed(e)},n.prototype.redAdd=function(e){return this.red.add(this,e)},n.prototype.redIAdd=function(e){return this.red.iadd(this,e)},n.prototype.redSub=function(e){return this.red.sub(this,e)},n.prototype.redISub=function(e){return this.red.isub(this,e)},n.prototype.redShl=function(e){return this.red.shl(this,e)},n.prototype.redMul=function(e){return this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function $(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function B(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(w,v),w.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=o}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},w.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]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new $;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},A.prototype._verify1=function(e){},A.prototype._verify2=function(e,t){},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.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)},A.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},A.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)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();if(3===this.m.andln(3)){var t=this.m.add(new n(1)).iushrn(2);return this.pow(e,t)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);var o=new n(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);0!==this.pow(c,s).cmp(a);)c.redIAdd(a);for(var u=this.pow(c,r),f=this.pow(e,r.addn(1).iushrn(1)),h=this.pow(e,r),l=i;0!==h.cmp(o);){for(var _=h,d=0;0!==_.cmp(o);d++)_=_.redSqr();var p=this.pow(u,new n(1).iushln(l-d-1));f=f.redMul(p),u=p.redSqr(),h=h.redMul(u),l=d}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i=0;i--){for(var u=t.words[i],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===i&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new B(e)},i(B,A),B.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},B.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},B.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},B.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(_$bn_245,this),_$bn_245=_$bn_245.exports;var _$safer_425={};(function(t){(function(){"use strict";var r,i=_$buffer_267({}),n=i.Buffer,o={};for(r in i)i.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(o[r]=i[r]);var a=o.Buffer={};for(r in n)n.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(a[r]=n[r]);if(o.Buffer.prototype=n.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return n(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=n(e);return t&&0!==t.length?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),_$safer_425=o}).call(this)}).call(this,_$browser_408);var _$reporter_110={};function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function ReporterError(e,t){this.path=e,this.rethrow(t)}_$reporter_110.Reporter=Reporter,Reporter.prototype.isError=function(e){return e instanceof ReporterError},Reporter.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},Reporter.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},Reporter.prototype.enterKey=function(e){return this._reporterState.path.push(e)},Reporter.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},Reporter.prototype.leaveKey=function(e,t,r){const i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},Reporter.prototype.path=function(){return this._reporterState.path.join("/")},Reporter.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},Reporter.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},Reporter.prototype.error=function(e){let t;const r=this._reporterState,i=e instanceof ReporterError;if(t=i?e:new ReporterError(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return i||r.errors.push(t),t},Reporter.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},_$inherits_browser_388(ReporterError,Error),ReporterError.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this};var _$buffer_107={};const __Reporter_107=_$reporter_110.Reporter,__Buffer_107=_$safer_425.Buffer;function DecoderBuffer(e,t){__Reporter_107.call(this,t),__Buffer_107.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function EncoderBuffer(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return EncoderBuffer.isEncoderBuffer(e)||(e=new EncoderBuffer(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=__Buffer_107.byteLength(e);else{if(!__Buffer_107.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}_$inherits_browser_388(DecoderBuffer,__Reporter_107),_$buffer_107.DecoderBuffer=DecoderBuffer,DecoderBuffer.isDecoderBuffer=function(e){return e instanceof DecoderBuffer||"object"==typeof e&&__Buffer_107.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:__Reporter_107.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(e){const t=new DecoderBuffer(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,__Reporter_107.prototype.restore.call(this,e.reporter),t},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new DecoderBuffer(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},DecoderBuffer.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},_$buffer_107.EncoderBuffer=EncoderBuffer,EncoderBuffer.isEncoderBuffer=function(e){return e instanceof EncoderBuffer||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},EncoderBuffer.prototype.join=function(e,t){return e||(e=__Buffer_107.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):__Buffer_107.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e};const __Reporter_109=_$reporter_110.Reporter,__EncoderBuffer_109=_$buffer_107.EncoderBuffer,__DecoderBuffer_109=_$buffer_107.DecoderBuffer,tags=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags);function Node(e,t,r){const i={};this._baseState=i,i.name=r,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}var _$Node_109=Node;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function(){const e=this._baseState,t={};stateProps.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},Node.prototype._wrap=function(){const e=this._baseState;methods.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},Node.prototype._init=function(e){const t=this._baseState;e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this)},Node.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const i=e[r];t[i]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){Node.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),tags.forEach((function(e){Node.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return t.tag=e,this._useArgs(r),this}})),Node.prototype.use=function(e){return this._baseState.use=e,this},Node.prototype.optional=function(){return this._baseState.optional=!0,this},Node.prototype.def=function(e){const t=this._baseState;return t.default=e,t.optional=!0,this},Node.prototype.explicit=function(e){return this._baseState.explicit=e,this},Node.prototype.implicit=function(e){return this._baseState.implicit=e,this},Node.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},Node.prototype.key=function(e){return this._baseState.key=e,this},Node.prototype.any=function(){return this._baseState.any=!0,this},Node.prototype.choice=function(e){return this._baseState.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},Node.prototype.contains=function(e){return this._baseState.contains=e,this},Node.prototype._decode=function(t,r){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,r));let n,o=i.default,a=!0,s=null;if(null!==i.key&&(s=t.enterKey(i.key)),i.optional){let n=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(a=this._peekTag(t,n,i.any),t.isError(a))return a}else{const n=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r),a=!0}catch(e){a=!1}t.restore(n)}}if(i.obj&&a&&(n=t.enterObject()),a){if(null!==i.explicit){const e=this._decodeTag(t,i.explicit);if(t.isError(e))return e;t=e}const e=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());const r=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(r))return r;i.any?o=t.raw(e):t=r}if(r&&r.track&&null!==i.tag&&r.track(t.path(),e,t.length,"tagged"),r&&r.track&&null!==i.tag&&r.track(t.path(),t.offset,t.length,"content"),i.any||(o=null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r)),t.isError(o))return o;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(e){e._decode(t,r)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const e=new __DecoderBuffer_109(o);o=this._getUse(i.contains,t._reporterState.obj)._decode(e,r)}}return i.obj&&a&&(o=t.leaveObject(n)),null===i.key||null===o&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,i.key,o),o},Node.prototype._decodeGeneric=function(e,t,r){const i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},Node.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},Node.prototype._decodeChoice=function(t,r){const i=this._baseState;let n=null,o=!1;return Object.keys(i.choice).some((function(a){const s=t.save(),c=i.choice[a];try{const e=c._decode(t,r);if(t.isError(e))return!1;n={type:a,value:e},o=!0}catch(e){return t.restore(s),!1}return!0}),this),o?n:t.error("Choice not matched")},Node.prototype._createEncoderBuffer=function(e){return new __EncoderBuffer_109(e,this.reporter)},Node.prototype._encode=function(e,t,r){const i=this._baseState;if(null!==i.default&&i.default===e)return;const n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n},Node.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new __Reporter_109);let n=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let o=null,a=!1;if(i.any)n=this._createEncoderBuffer(e);else if(i.choice)n=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,r)._encode(e,t),a=!0;else if(i.children)o=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const i=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),n}),this).filter((function(e){return e})),o=this._createEncoderBuffer(o);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,o=this._createEncoderBuffer(e.map((function(r){const i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),r))}else null!==i.use?n=this._getUse(i.use,r)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(n=this._encodeComposite(e,a,r,o))}return null!==i.explicit&&(n=this._encodeComposite(i.explicit,!1,"context",n)),n},Node.prototype._encodeChoice=function(e,t){return this._baseState.choice[e.type]._encode(e.value,t)},Node.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},Node.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},Node.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)};var _$der_111={};function reverse(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const i=e[r];t[i]=r})),t}_$der_111.tagClass={0:"universal",1:"application",2:"context",3:"private"},_$der_111.tagClassByName=reverse(_$der_111.tagClass),_$der_111.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},_$der_111.tagByName=reverse(_$der_111.tag);var _$der_116={};const __Buffer_116=_$safer_425.Buffer;function DEREncoder(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new DERNode,this.tree._init(e.body)}function DERNode(e){_$Node_109.call(this,"der",e)}function two(e){return e<10?"0"+e:e}_$der_116=DEREncoder,DEREncoder.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},_$inherits_browser_388(DERNode,_$Node_109),DERNode.prototype._encodeComposite=function(e,t,r,i){const n=function(e,t,r,i){let n;if("seqof"===e?e="seq":"setof"===e&&(e="set"),_$der_111.tagByName.hasOwnProperty(e))n=_$der_111.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}return n>=31?i.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|_$der_111.tagClassByName[r||"universal"]<<6)}(e,t,r,this.reporter);if(i.length<128){const e=__Buffer_116.alloc(2);return e[0]=n,e[1]=i.length,this._createEncoderBuffer([e,i])}let o=1;for(let s=i.length;s>=256;s>>=8)o++;const a=__Buffer_116.alloc(2+o);a[0]=n,a[1]=128|o;for(let s=1+o,c=i.length;c>0;s--,c>>=8)a[s]=255&c;return this._createEncoderBuffer([a,i])},DERNode.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=__Buffer_116.alloc(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let i=0;for(let a=0;a=128;t>>=7)i++}const n=__Buffer_116.alloc(i);let o=n.length-1;for(let a=e.length-1;a>=0;a--){let t=e[a];for(n[o--]=127&t;(t>>=7)>0;)n[o--]=128|127&t}return this._createEncoderBuffer(n)},DERNode.prototype._encodeTime=function(e,t){let r;const i=new Date(e);return"gentime"===t?r=[two(i.getUTCFullYear()),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[two(i.getUTCFullYear()%100),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!__Buffer_116.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=__Buffer_116.from(t)}if(__Buffer_116.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=__Buffer_116.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let n=e;n>=256;n>>=8)r++;const i=new Array(r);for(let n=i.length-1;n>=0;n--)i[n]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(__Buffer_116.from(i))},DERNode.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},DERNode.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},DERNode.prototype._skipDefault=function(e,t,r){const i=this._baseState;let n;if(null===i.default)return!1;const o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=e.readUInt8(t),e.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:_$der_111.tag[r]}}function derDecodeLen(e,t,r){let i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(let o=0;o0&&r.ishrn(i),r}function makeKey(e,t,r){var i,n;do{for(i=__Buffer_243.alloc(0);8*i.length=t)throw new Error("invalid sig")}var _$verify_244=function(e,t,r,i,n){var o=_$parseAsn1_401(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=_$curves_241[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new __EC_244(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=_$parseAsn1_401.signature.decode(e,"der"),c=s.s,u=s.r;checkValue(c,n),checkValue(u,n);var f=_$bn_245.mont(i),h=c.invm(n);return 0===o.toRed(f).redPow(new _$bn_245(t).mul(h).mod(n)).fromRed().mul(a.toRed(f).redPow(u.mul(h).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=__Buffer_244.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],c=0;t.length+s.length+2r-a-2)throw new Error("message too long");var s=__Buffer_412.alloc(r-i-a-2),c=r-o-1,u=_$browser_421(o),f=_$xor_414(__Buffer_412.concat([n,s,__Buffer_412.alloc(1,1),t],c),_$mgf_410(u,c)),h=_$xor_414(u,_$mgf_410(f,o));return new _$bn_214(__Buffer_412.concat([__Buffer_412.alloc(1),h,f],r))}(o,t);else if(1===i)n=function(e,t,r){var i,n=t.length,o=e.modulus.byteLength();if(n>o-11)throw new Error("message too long");return i=r?__Buffer_412.alloc(o-n-3,255):function(e){for(var t,r=__Buffer_412.allocUnsafe(e),i=0,n=_$browser_421(2*e),o=0;i=0)throw new Error("data too long for modulus")}return r?_$browserifyRsa_237(n,o):_$withPublic_413(n,o)},__Buffer_411=_$safeBuffer_424.Buffer,_$privateDecrypt_411=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=_$parseAsn1_401(e),a=o.modulus.byteLength();if(t.length>a||new _$bn_214(t).cmp(o.modulus)>=0)throw new Error("decryption error");n=r?_$withPublic_413(new _$bn_214(t),o):_$browserifyRsa_237(t,o);var s=__Buffer_411.alloc(a-n.length);if(n=__Buffer_411.concat([s,n],a),4===i)return function(e,t){var r=e.modulus.byteLength(),i=_$browser_276("sha1").update(__Buffer_411.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=_$xor_414(o,_$mgf_410(a,n)),c=_$xor_414(a,_$mgf_410(s,r-n-1));if(function(e,t){e=__Buffer_411.from(e),t=__Buffer_411.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));for(var n=-1;++n=t.length){o++;break}var a=t.slice(2,n-1);if(("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")},_$browser_409={};_$browser_409.publicEncrypt=_$publicEncrypt_412,_$browser_409.privateDecrypt=_$privateDecrypt_411,_$browser_409.privateEncrypt=function(e,t){return _$browser_409.publicEncrypt(e,t,!0)},_$browser_409.publicDecrypt=function(e,t){return _$browser_409.privateDecrypt(e,t,!0)};var _$browser_422={};(function(e,t){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var i=_$safeBuffer_424.Buffer,n=_$safeBuffer_424.kMaxLength,o=t.crypto||t.msCrypto,a=Math.pow(2,32)-1;function s(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>a||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>t)throw new RangeError("offset out of range")}function c(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>a||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>n)throw new RangeError("buffer too small")}function u(t,r,i,n){if(e.browser){var a=t.buffer,s=new Uint8Array(a,r,i);return o.getRandomValues(s),n?void e.nextTick((function(){n(null,t)})):t}if(!n)return _$browser_421(i).copy(t,r),t;_$browser_421(i,(function(e,i){if(e)return n(e);i.copy(t,r),n(null,t)}))}o&&o.getRandomValues||!e.browser?(_$browser_422.randomFill=function(e,r,n,o){if(!(i.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)o=r,r=0,n=e.length;else if("function"==typeof n)o=n,n=e.length-r;else if("function"!=typeof o)throw new TypeError('"cb" argument must be a function');return s(r,e.length),c(n,r,e.length),u(e,r,n,o)},_$browser_422.randomFillSync=function(e,r,n){if(void 0===r&&(r=0),!(i.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return s(r,e.length),void 0===n&&(n=e.length-r),c(n,r,e.length),u(e,r,n)}):(_$browser_422.randomFill=r,_$browser_422.randomFillSync=r)}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$utils_430={};(function(e,t){(function(){const r=_$cryptoBrowserify_280({});function i(e,t,r,i,n,c,u){let f;for(s(e,t+64*(2*i-1),n,0,64),f=0;f<2*i;f++)a(e,64*f,n,0,64),o(n,c,u),s(n,0,e,r+64*f,64);for(f=0;f>>32-t}function o(e,t,r){let i;for(i=0;i<16;i++)t[i]=(255&e[4*i+0])<<0,t[i]|=(255&e[4*i+1])<<8,t[i]|=(255&e[4*i+2])<<16,t[i]|=(255&e[4*i+3])<<24;for(s(t,0,r,0,16),i=8;i>0;i-=2)r[4]^=n(r[0]+r[12],7),r[8]^=n(r[4]+r[0],9),r[12]^=n(r[8]+r[4],13),r[0]^=n(r[12]+r[8],18),r[9]^=n(r[5]+r[1],7),r[13]^=n(r[9]+r[5],9),r[1]^=n(r[13]+r[9],13),r[5]^=n(r[1]+r[13],18),r[14]^=n(r[10]+r[6],7),r[2]^=n(r[14]+r[10],9),r[6]^=n(r[2]+r[14],13),r[10]^=n(r[6]+r[2],18),r[3]^=n(r[15]+r[11],7),r[7]^=n(r[3]+r[15],9),r[11]^=n(r[7]+r[3],13),r[15]^=n(r[11]+r[7],18),r[1]^=n(r[0]+r[3],7),r[2]^=n(r[1]+r[0],9),r[3]^=n(r[2]+r[1],13),r[0]^=n(r[3]+r[2],18),r[6]^=n(r[5]+r[4],7),r[7]^=n(r[6]+r[5],9),r[4]^=n(r[7]+r[6],13),r[5]^=n(r[4]+r[7],18),r[11]^=n(r[10]+r[9],7),r[8]^=n(r[11]+r[10],9),r[9]^=n(r[8]+r[11],13),r[10]^=n(r[9]+r[8],18),r[12]^=n(r[15]+r[14],7),r[13]^=n(r[12]+r[15],9),r[14]^=n(r[13]+r[12],13),r[15]^=n(r[14]+r[13],18);for(i=0;i<16;++i)t[i]=r[i]+t[i];for(i=0;i<16;i++){let r=4*i;e[r+0]=t[i]>>0&255,e[r+1]=t[i]>>8&255,e[r+2]=t[i]>>16&255,e[r+3]=t[i]>>24&255}}function a(e,t,r,i,n){for(let o=0;o 0 and a power of 2");if(n>2147483647/128/o)throw Error("Parameter N is too large");if(o>2147483647/128/a)throw Error("Parameter r is too large");let u,f=e.alloc(256*o),h=e.alloc(128*o*n),l=new Int32Array(16),_=new Int32Array(16),d=e.alloc(64),p=r.pbkdf2Sync(t,i,1,128*a*o,"sha256");if(c){let e=a*n*2,t=0;u=function(){++t%1e3==0&&c({current:t,total:e,percent:t/e*100})}}return{XY:f,V:h,B32:l,x:_,_X:d,B:p,tickCallback:u}},smix:async function(e,r,n,o,s,c,u,f,h,l,_){_=_||5e3;let d,p=128*n;for(e.copy(c,0,r,r+p),d=0;dt(e)),i(c,0,p,n,u,f,h),l&&l();for(d=0;dt(e)),i(c,0,p,n,u,f,h),l&&l()}c.copy(e,r,0,0+p)},smixSync:function(e,t,r,n,o,s,c,u,f,h){let l,_=128*r;for(e.copy(s,0,t,t+_),l=0;l=0&&(i=!0)})),Object.keys(t).forEach((function(e){r+=o[e]*t[e]})),i&&(r+=2),r+=40,Math.ceil(r/4)}encryptBIP38(e,t){const r=_$wif_475.decode(e);return _$bip38_201.encrypt(r.privateKey,r.compressed,t)}decryptBIP38(e,t,r="mainnet"){const i=_$bip38_201.decrypt(e,t);let n;return n="testnet"===r?239:128,_$wif_475.encode(n,i.privateKey,i.compressed)}},_$browser_12={};(function(e,t){(function(){"use strict";var r=_$safeBuffer_13.Buffer,i=t.crypto||t.msCrypto;_$browser_12=i&&i.getRandomValues?function(n,o){if(n>65536)throw new Error("requested too many random bytes");var a=new t.Uint8Array(n);n>0&&i.getRandomValues(a);var s=r.from(a.buffer);return"function"==typeof o?e.nextTick((function(){o(null,s)})):s}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var _$crypto_19=class{static sha256(e){return _$src_55.crypto.sha256(e)}static ripemd160(e){return _$src_55.crypto.ripemd160(e)}static hash256(e){return _$src_55.crypto.hash256(e)}static hash160(e){return _$src_55.crypto.hash160(e)}static randomBytes(e=16){return _$browser_12(e)}},_$bind_137=function(e,t){return function(){for(var r=new Array(arguments.length),i=0;i=0)return;n[t]="set-cookie"===t?(n[t]?n[t]:[]).concat([r]):n[t]?n[t]+", "+r:r}})),n):n},_$isURLSameOrigin_143=_$utils_148.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var i=e;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=_$utils_148.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},_$Cancel_122={};function Cancel(e){this.message=e}Cancel.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,_$Cancel_122=Cancel;var _$xhr_120=function(e){return new Promise((function(t,r){var i,n=e.data,o=e.headers,a=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}_$utils_148.isFormData(n)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+f)}var h=_$buildFullPath_127(e.baseURL,e.url);function l(){if(c){var i="getAllResponseHeaders"in c?_$parseHeaders_145(c.getAllResponseHeaders()):null,n={data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c};_$settle_132((function(e){t(e),s()}),(function(e){r(e),s()}),n),c=null}}if(c.open(e.method.toUpperCase(),_$buildURL_138(h,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(r(_$createError_128("Request aborted",e,"ECONNABORTED",c)),c=null)},c.onerror=function(){r(_$createError_128("Network Error",e,null,c)),c=null},c.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",i=e.transitional||_$transitional_135;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(_$createError_128(t,e,i.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},_$utils_148.isStandardBrowserEnv()){var _=(e.withCredentials||_$isURLSameOrigin_143(h))&&e.xsrfCookieName?_$cookies_140.read(e.xsrfCookieName):void 0;_&&(o[e.xsrfHeaderName]=_)}"setRequestHeader"in c&&_$utils_148.forEach(o,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,e)})),_$utils_148.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(i=function(e){c&&(r(!e||e&&e.type?new _$Cancel_122("canceled"):e),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i))),n||(n=null),c.send(n)}))},_$defaults_134={};(function(t){(function(){"use strict";var r={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!_$utils_148.isUndefined(e)&&_$utils_148.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var n,o={transitional:_$transitional_135,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(n=_$xhr_120),n),transformRequest:[function(t,r){return _$normalizeHeaderName_144(r,"Accept"),_$normalizeHeaderName_144(r,"Content-Type"),_$utils_148.isFormData(t)||_$utils_148.isArrayBuffer(t)||_$utils_148.isBuffer(t)||_$utils_148.isStream(t)||_$utils_148.isFile(t)||_$utils_148.isBlob(t)?t:_$utils_148.isArrayBufferView(t)?t.buffer:_$utils_148.isURLSearchParams(t)?(i(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_$utils_148.isObject(t)||r&&"application/json"===r["Content-Type"]?(i(r,"application/json"),function(t,r,i){if(_$utils_148.isString(t))try{return(0,JSON.parse)(t),_$utils_148.trim(t)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var r=this.transitional||o.transitional,i=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,a=!i&&"json"===this.responseType;if(a||n&&_$utils_148.isString(t)&&t.length)try{return JSON.parse(t)}catch(e){if(a){if("SyntaxError"===e.name)throw _$enhanceError_130(e,this,"E_JSON_PARSE");throw e}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_$utils_148.forEach(["delete","get","head"],(function(e){o.headers[e]={}})),_$utils_148.forEach(["post","put","patch"],(function(e){o.headers[e]=_$utils_148.merge(r)})),_$defaults_134=o}).call(this)}).call(this,_$browser_408);var _$transformData_133=function(e,t,r){var i=this||_$defaults_134;return _$utils_148.forEach(r,(function(r){e=r.call(i,e,t)})),e},_$isCancel_124=function(e){return!(!e||!e.__CANCEL__)};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _$Cancel_122("canceled")}var _$dispatchRequest_129=function(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=_$transformData_133.call(e,e.data,e.headers,e.transformRequest),e.headers=_$utils_148.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_$utils_148.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||_$defaults_134.adapter)(e).then((function(t){return throwIfCancellationRequested(e),t.data=_$transformData_133.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return _$isCancel_124(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=_$transformData_133.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},_$mergeConfig_131=function(e,t){t=t||{};var r={};function i(e,t){return _$utils_148.isPlainObject(e)&&_$utils_148.isPlainObject(t)?_$utils_148.merge(e,t):_$utils_148.isPlainObject(t)?_$utils_148.merge({},t):_$utils_148.isArray(t)?t.slice():t}function n(r){return _$utils_148.isUndefined(t[r])?_$utils_148.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function o(e){if(!_$utils_148.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return _$utils_148.isUndefined(t[r])?_$utils_148.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function s(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return _$utils_148.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||n,i=t(e);_$utils_148.isUndefined(i)&&t!==s||(r[e]=i)})),r},_$data_136={version:"0.26.1"},_$validator_147={},VERSION=_$data_136.version,validators={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};validators.transitional=function(e,t,r){function i(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!deprecatedWarnings[n]&&(deprecatedWarnings[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},_$validator_147={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var i=Object.keys(e),n=i.length;n-- >0;){var o=i[n],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:validators};var _$Axios_125={},__validators_125=_$validator_147.validators;function Axios(e){this.defaults=e,this.interceptors={request:new _$InterceptorManager_126,response:new _$InterceptorManager_126}}Axios.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=_$mergeConfig_131(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&_$validator_147.assertOptions(r,{silentJSONParsing:__validators_125.transitional(__validators_125.boolean),forcedJSONParsing:__validators_125.transitional(__validators_125.boolean),clarifyTimeoutError:__validators_125.transitional(__validators_125.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var o,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!n){var s=[_$dispatchRequest_129,void 0];for(Array.prototype.unshift.apply(s,i),s=s.concat(a),o=Promise.resolve(t);s.length;)o=o.then(s.shift(),s.shift());return o}for(var c=t;i.length;){var u=i.shift(),f=i.shift();try{c=u(c)}catch(h){f(h);break}}try{o=_$dispatchRequest_129(c)}catch(h){return Promise.reject(h)}for(;a.length;)o=o.then(a.shift(),a.shift());return o},Axios.prototype.getUri=function(e){return e=_$mergeConfig_131(this.defaults,e),_$buildURL_138(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},_$utils_148.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(_$mergeConfig_131(r||{},{method:e,url:t,data:(r||{}).data}))}})),_$utils_148.forEach(["post","put","patch"],(function(e){Axios.prototype[e]=function(t,r,i){return this.request(_$mergeConfig_131(i||{},{method:e,url:t,data:r}))}})),_$Axios_125=Axios;var _$CancelToken_123={};function CancelToken(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;this.promise.then((function(e){if(r._listeners){var t,i=r._listeners.length;for(t=0;tsetTimeout(t,e))}async validateAddress(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}util/validateAddress/${e}`,this.axiosOptions)).data;if(Array.isArray(e)){const t={method:"POST",url:this.restURL+"util/validateAddress",data:{addresses:e}},r=Object.assign({},t,this.axiosOptions);return(await _$axios_119(r)).data}throw new Error("Input must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}},_$blockchain_17=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}}}async getBestBlockHash(){try{return(await _$axios_119.get(this.restURL+"blockchain/getBestBlockHash",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getBlock(e,t=1){try{if(!e||"string"!=typeof e)throw new Error("blockhash must be a string");return(await _$axios_119.post(this.restURL+"blockchain/getblock",{blockhash:e,verbosity:t},this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response.data:r}}async getBlockchainInfo(){try{return(await _$axios_119.get(this.restURL+"blockchain/getBlockchainInfo",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getBlockCount(){try{return(await _$axios_119.get(this.restURL+"blockchain/getBlockCount",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getBlockHash(e=1){"string"!=typeof e&&(e=JSON.stringify(e));try{return(await _$axios_119.get(`${this.restURL}blockchain/getBlockHash/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}async getBlockHeader(e,t=!0){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}blockchain/getBlockHeader/${e}?verbose=${t}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"blockchain/getBlockHeader",{hashes:e,verbose:t},this.axiosOptions)).data;throw new Error("Input hash must be a string or array of strings.")}catch(r){throw r.response&&r.response.data?r.response.data:r}}async getChainTips(){try{return(await _$axios_119.get(this.restURL+"blockchain/getChainTips",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getDifficulty(){try{return(await _$axios_119.get(this.restURL+"blockchain/getDifficulty",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getMempoolAncestors(e,t=!1){"string"!=typeof e&&(e=JSON.stringify(e));try{return(await _$axios_119.get(`${this.restURL}blockchain/getMempoolAncestors/${e}?verbose=${t}`,this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response.data:r}}async getMempoolDescendants(e,t=!1){"string"!=typeof e&&(e=JSON.stringify(e));try{return(await _$axios_119.get(`${this.restURL}blockchain/getMempoolDescendants/${e}?verbose=${t}`,this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response.data:r}}async getMempoolEntry(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}blockchain/getMempoolEntry/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"blockchain/getMempoolEntry",{txids:e},this.axiosOptions)).data;throw new Error("Input must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async getMempoolInfo(){try{return(await _$axios_119.get(this.restURL+"blockchain/getMempoolInfo",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getRawMempool(e=!1){try{return(await _$axios_119.get(`${this.restURL}blockchain/getRawMempool?vebose=${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}async getTxOut(e,t,r=!0){try{if("string"!=typeof e||64!==e.length)throw new Error("txid needs to be a proper transaction ID");if(isNaN(t))throw new Error("n must be an integer");if("boolean"!=typeof r)throw new Error("includeMempool input must be of type boolean");return(await _$axios_119.post(this.restURL+"blockchain/getTxOut",{txid:e,vout:t,mempool:r},this.axiosOptions)).data}catch(i){throw i.response&&i.response.data?i.response.data:i}}async getTxOutProof(e){try{if("string"==typeof e){const t=`${this.restURL}blockchain/getTxOutProof/${e}`;return(await _$axios_119.get(t,this.axiosOptions)).data}if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"blockchain/getTxOutProof",{txids:e},this.axiosOptions)).data;throw new Error("Input must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async preciousBlock(e){try{return(await _$axios_119.get(`${this.restURL}blockchain/preciousBlock/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}async pruneBlockchain(e){try{return(await _$axios_119.post(`${this.restURL}blockchain/pruneBlockchain/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}async verifyChain(e=3,t=6){try{return(await _$axios_119.get(`${this.restURL}blockchain/verifyChain?checklevel=${e}&nblocks=${t}`,this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response.data:r}}async verifyTxOutProof(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}blockchain/verifyTxOutProof/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"blockchain/verifyTxOutProof",{proofs:e},this.axiosOptions)).data;throw new Error("Input must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}},_$control_18=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}}}async getNetworkInfo(){try{return(await _$axios_119.get(this.restURL+"control/getNetworkInfo",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getMemoryInfo(){try{return(await _$axios_119.get(this.restURL+"control/getMemoryInfo",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}},_$generating_25=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}}}async generateToAddress(e,t,r=1e6){try{return(await _$axios_119.post(`${this.restURL}generating/generateToAddress/${e}/${t}?maxtries=${r}`,this.axiosOptions)).data}catch(i){throw i.response&&i.response.data?i.response.data:i}}},_$mining_27=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}}}async getBlockTemplate(e){try{return(await _$axios_119.get(`${this.restURL}mining/getBlockTemplate/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}async getMiningInfo(){try{return(await _$axios_119.get(this.restURL+"mining/getMiningInfo",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async getNetworkHashps(e=120,t=1){try{return(await _$axios_119.get(`${this.restURL}mining/getNetworkHashps?nblocks=${e}&height=${t}`,this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response.data:r}}async submitBlock(e,t){let r=`${this.restURL}mining/submitBlock/${e}`;t&&(r=`${r}?parameters=${t}`);try{return(await _$axios_119.post(r,this.axiosOptions)).data}catch(i){throw i.response&&i.response.data?i.response.data:i}}},_$rawTransactions_31=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},this.axios=_$axios_119}async decodeRawTransaction(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}rawtransactions/decodeRawTransaction/${e}`,this.axiosOptions)).data;if(Array.isArray(e)){const t={method:"POST",url:this.restURL+"rawtransactions/decodeRawTransaction",data:{hexes:e},headers:this.axiosOptions.headers};return(await _$axios_119(t)).data}throw new Error("Input must be a string or array of strings.")}catch(t){throw t.error?new Error(t.error):t.response&&t.response.data?t.response.data:t}}async decodeScript(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}rawtransactions/decodeScript/${e}`,this.axiosOptions)).data;if(Array.isArray(e)){const t={method:"POST",url:this.restURL+"rawtransactions/decodeScript",data:{hexes:e},headers:this.axiosOptions.headers};return(await _$axios_119(t)).data}throw new Error("Input must be a string or array of strings.")}catch(t){throw t.error?new Error(t.error):t.response&&t.response.data?t.response.data:t}}async getRawTransaction(e,t=!1,r=null){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}rawtransactions/getRawTransaction/${e}?verbose=${t}`,this.axiosOptions)).data;if(Array.isArray(e)){const i={method:"POST",url:this.restURL+"rawtransactions/getRawTransaction",data:{txids:e,verbose:t,usrObj:r},headers:this.axiosOptions.headers};return(await _$axios_119(i)).data}throw new Error("Input must be a string or array of strings.")}catch(i){if(i.error)throw new Error(i.error);throw i.response&&i.response.data&&i.response.data.error?new Error(i.response.data.error):i.response&&i.response.data?i.response.data:i}}async _getInputAddrs(e){try{const t=[];for(let r=0;rn(e.toString(2),"0",8)).join("")}function s(e){const t=8*e.length/32;return a([..._$browser_276("sha256").update(e).digest()]).slice(0,t)}function c(e){return"mnemonic"+(e||"")}function u(e,a){if(!(a=a||r))throw new Error(i);const c=(e||"").normalize("NFKD").split(" ");if(c.length%3!=0)throw new Error("Invalid mnemonic");const u=c.map(e=>{const t=a.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return n(t.toString(2),"0",11)}).join(""),f=32*Math.floor(u.length/33),h=u.slice(0,f),l=u.slice(f),_=h.match(/(.{1,8})/g).map(o);if(_.length<16)throw new Error("Invalid entropy");if(_.length>32)throw new Error("Invalid entropy");if(_.length%4!=0)throw new Error("Invalid entropy");const d=t.from(_);if(s(d)!==l)throw new Error("Invalid mnemonic checksum");return d.toString("hex")}function f(e,n){if(t.isBuffer(e)||(e=t.from(e,"hex")),!(n=n||r))throw new Error(i);if(e.length<16)throw new TypeError("Invalid entropy");if(e.length>32)throw new TypeError("Invalid entropy");if(e.length%4!=0)throw new TypeError("Invalid entropy");const c=(a([...e])+s(e)).match(/(.{1,11})/g).map(e=>{const t=o(e);return n[t]});return"\u3042\u3044\u3053\u304f\u3057\u3093"===n[0]?c.join("\u3000"):c.join(" ")}_$src_203.mnemonicToSeed=function(e,r){return new Promise((i,n)=>{try{const o=t.from((e||"").normalize("NFKD"),"utf8"),a=t.from(c((r||"").normalize("NFKD")),"utf8");_$browser_402.pbkdf2(o,a,2048,64,"sha512",(e,t)=>e?n(e):i(t))}catch(o){return n(o)}})},_$src_203.mnemonicToEntropy=u,_$src_203.entropyToMnemonic=f,_$src_203.generateMnemonic=function(e,t,r){if((e=e||128)%32!=0)throw new TypeError("Invalid entropy");return f((t=t||_$browser_421)(e/8),r)},_$src_203.validateMnemonic=function(t,r){try{u(t,r)}catch(e){return!1}return!0},_$src_203.wordlists=_$_wordlists_202.wordlists}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$mnemonic_28={};(function(e){(function(){const t=_$safeBuffer_13.Buffer;_$mnemonic_28=class{constructor(e){this._address=e}generate(e=128,t){return _$src_203.generateMnemonic(e,_$browser_12,t)}fromEntropy(e,t){return _$src_203.entropyToMnemonic(e,t)}toEntropy(e,r){return t.from(_$src_203.mnemonicToEntropy(e,r),"hex")}validate(e,t){const r=e.split(" ");if(0===r.length)return"Blank mnemonic";for(let i=0;i(s=i+1)&&(n=s),n>(s=r[a+1]+1)&&(n=s),r[a]=i;r[a]=n}return n},getAsync:function(t,r,i,n){if(n=function(e){const t=Array.prototype.slice.call(arguments,1);for(let r=0;r(f=a+1)&&(s=f),f=o[u+1]+1,s>f&&(s=f),o[u]=a,l=(new Date).valueOf()}if(null!==n.progress)try{n.progress.call(null,100*c/t.length)}catch(err){return i("Progress callback: "+err.toString())}var d;d=_,"function"==typeof e?e(d):setTimeout(d,0)};_()}}}).call(this)}).call(this,_$main_468({}).setImmediate);var _$validation_328={};function ValidationError(e){var t=new Error;this.name=t.name="ValidationError",this.message=t.message=e,this.stack=t.stack}ValidationError.prototype=Object.create(Error.prototype),_$validation_328={ValidationError:ValidationError,validate:function(e,t){if(!e)throw new ValidationError(t)}};var validate=_$validation_328.validate,CHARSET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",CHARSET_INVERSE_INDEX={q:0,p:1,z:2,r:3,y:4,9:5,x:6,8:7,g:8,f:9,2:10,t:11,v:12,d:13,w:14,0:15,s:16,3:17,j:18,n:19,5:20,4:21,k:22,h:23,c:24,e:25,6:26,m:27,u:28,a:29,7:30,l:31},_$base32_325={encode:function(e){validate(e instanceof Uint8Array,"Invalid data: "+e+".");for(var t="",r=0;r0?Math.floor(e):Math.ceil(e)}function d(e,r){var i,n,o=e.length,a=r.length,s=new Array(o),c=0,u=t;for(n=0;n=u?1:0,s[n]=i-c*u;for(;n0&&s.push(c),s}function p(e,t){return e.length>=t.length?d(e,t):d(t,e)}function m(e,r){var i,n,o=e.length,a=new Array(o),s=t;for(n=0;n0;)a[n++]=r%s,r=Math.floor(r/s);return a}function b(e,t){var r,i,n=e.length,o=t.length,a=new Array(n),s=0;for(r=0;r0;)a[n++]=c%s,c=Math.floor(c/s);return a}function w(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function $(e,r,i){return new a(e=0;--r)n=(o=1e7*n+e[r])-(i=_(o/t))*t,s[r]=0|i;return[s,0|n]}function A(e,r){var i,n,c=K(r),d=e.value,p=c.value;if(0===p)throw new Error("Cannot divide by zero");if(e.isSmall)return c.isSmall?[new s(_(d/p)),new s(d%p)]:[o[0],e];if(c.isSmall){if(1===p)return[e,o[0]];if(-1==p)return[e.negate(),o[0]];var m=Math.abs(p);if(m=0;n--){for(i=d-1,g[n+_]!==m&&(i=Math.floor((g[n+_]*d+g[n+_-1])/m)),o=0,a=0,c=y.length,s=0;sc&&(n=1e7*(n+1)),r=Math.ceil(n/o);do{if(B(a=v(t,r),l)<=0)break;r--}while(r);u.push(r),l=b(l,a)}return u.reverse(),[f(u),f(l)]}(d,p))[0];var w=e.sign!==c.sign,$=i[1],E=e.sign;return"number"==typeof n?(w&&(n=-n),n=new s(n)):n=new a(n,w),"number"==typeof $?(E&&($=-$),$=new s($)):$=new a($,E),[n,$]}function B(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var r=e.length-1;r>=0;r--)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return 0}function k(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function M(e,t){for(var r,i,n,a=e.prev(),s=a,c=0;s.isEven();)s=s.divide(2),c++;e:for(i=0;i=0?i=b(e,t):(i=b(t,e),r=!r),"number"==typeof(i=f(i))?(r&&(i=-i),new s(i)):new a(i,r)}(r,i,this.sign)},a.prototype.minus=a.prototype.subtract,s.prototype.subtract=function(e){var t=K(e),r=this.value;if(r<0!==t.sign)return this.add(t.negate());var i=t.value;return t.isSmall?new s(r-i):g(i,Math.abs(r),r>=0)},s.prototype.minus=s.prototype.subtract,a.prototype.negate=function(){return new a(this.value,!this.sign)},s.prototype.negate=function(){var e=this.sign,t=new s(-this.value);return t.sign=!e,t},a.prototype.abs=function(){return new a(this.value,!1)},s.prototype.abs=function(){return new s(Math.abs(this.value))},a.prototype.multiply=function(e){var r,i,n,s=K(e),c=this.value,f=s.value,l=this.sign!==s.sign;if(s.isSmall){if(0===f)return o[0];if(1===f)return this;if(-1===f)return this.negate();if((r=Math.abs(f))0?function e(t,r){var i=Math.max(t.length,r.length);if(i<=30)return y(t,r);i=Math.ceil(i/2);var n=t.slice(i),o=t.slice(0,i),a=r.slice(i),s=r.slice(0,i),c=e(o,s),u=e(n,a),f=e(p(o,n),p(s,a)),l=p(p(c,w(b(b(f,c),u),i)),w(u,2*i));return h(l),l}(c,f):y(c,f),l)},a.prototype.times=a.prototype.multiply,s.prototype._multiplyBySmall=function(e){return c(e.value*this.value)?new s(e.value*this.value):$(Math.abs(e.value),u(Math.abs(this.value)),this.sign!==e.sign)},a.prototype._multiplyBySmall=function(e){return 0===e.value?o[0]:1===e.value?this:-1===e.value?this.negate():$(Math.abs(e.value),this.value,this.sign!==e.sign)},s.prototype.multiply=function(e){return K(e)._multiplyBySmall(this)},s.prototype.times=s.prototype.multiply,a.prototype.square=function(){return new a(E(this.value),!1)},s.prototype.square=function(){var e=this.value*this.value;return c(e)?new s(e):new a(E(u(Math.abs(this.value))),!1)},a.prototype.divmod=function(e){var t=A(this,e);return{quotient:t[0],remainder:t[1]}},s.prototype.divmod=a.prototype.divmod,a.prototype.divide=function(e){return A(this,e)[0]},s.prototype.over=s.prototype.divide=a.prototype.over=a.prototype.divide,a.prototype.mod=function(e){return A(this,e)[1]},s.prototype.remainder=s.prototype.mod=a.prototype.remainder=a.prototype.mod,a.prototype.pow=function(e){var t,r,i,n=K(e),a=this.value,u=n.value;if(0===u)return o[1];if(0===a)return o[0];if(1===a)return o[1];if(-1===a)return n.isEven()?o[1]:o[-1];if(n.sign)return o[0];if(!n.isSmall)throw new Error("The exponent "+n.toString()+" is too large.");if(this.isSmall&&c(t=Math.pow(a,u)))return new s(_(t));for(r=this,i=o[1];!0&u&&(i=i.times(r),--u),0!==u;)u/=2,r=r.square();return i},s.prototype.pow=a.prototype.pow,a.prototype.modPow=function(e,t){if(e=K(e),(t=K(t)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var r=o[1],i=this.mod(t);e.isPositive();){if(i.isZero())return o[0];e.isOdd()&&(r=r.multiply(i).mod(t)),e=e.divide(2),i=i.square().mod(t)}return r},s.prototype.modPow=a.prototype.modPow,a.prototype.compareAbs=function(e){var t=K(e),r=this.value,i=t.value;return t.isSmall?1:B(r,i)},s.prototype.compareAbs=function(e){var t=K(e),r=Math.abs(this.value),i=t.value;return t.isSmall?r===(i=Math.abs(i))?0:r>i?1:-1:-1},a.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=K(e),r=this.value,i=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:B(r,i)*(this.sign?-1:1)},a.prototype.compareTo=a.prototype.compare,s.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=K(e),r=this.value,i=t.value;return t.isSmall?r==i?0:r>i?1:-1:r<0!==t.sign?r<0?-1:1:r<0?1:-1},s.prototype.compareTo=s.prototype.compare,a.prototype.equals=function(e){return 0===this.compare(e)},s.prototype.eq=s.prototype.equals=a.prototype.eq=a.prototype.equals,a.prototype.notEquals=function(e){return 0!==this.compare(e)},s.prototype.neq=s.prototype.notEquals=a.prototype.neq=a.prototype.notEquals,a.prototype.greater=function(e){return this.compare(e)>0},s.prototype.gt=s.prototype.greater=a.prototype.gt=a.prototype.greater,a.prototype.lesser=function(e){return this.compare(e)<0},s.prototype.lt=s.prototype.lesser=a.prototype.lt=a.prototype.lesser,a.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},s.prototype.geq=s.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals,a.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},s.prototype.leq=s.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals,a.prototype.isEven=function(){return 0==(1&this.value[0])},s.prototype.isEven=function(){return 0==(1&this.value)},a.prototype.isOdd=function(){return 1==(1&this.value[0])},s.prototype.isOdd=function(){return 1==(1&this.value)},a.prototype.isPositive=function(){return!this.sign},s.prototype.isPositive=function(){return this.value>0},a.prototype.isNegative=function(){return this.sign},s.prototype.isNegative=function(){return this.value<0},a.prototype.isUnit=function(){return!1},s.prototype.isUnit=function(){return 1===Math.abs(this.value)},a.prototype.isZero=function(){return!1},s.prototype.isZero=function(){return 0===this.value},a.prototype.isDivisibleBy=function(e){var t=K(e),r=t.value;return 0!==r&&(1===r||(2===r?this.isEven():this.mod(t).equals(o[0])))},s.prototype.isDivisibleBy=a.prototype.isDivisibleBy,a.prototype.isPrime=function(e){var t=k(this);if(void 0!==t)return t;var r=this.abs(),i=r.bitLength();if(i<=64)return M(r,[2,325,9375,28178,450775,9780504,1795265022]);for(var n=Math.log(2)*i,o=Math.ceil(!0===e?2*Math.pow(n,2):n),a=[],s=0;s-r?new s(e-1):new a(i,!0)};for(var T=[1];2*T[T.length-1]<=t;)T.push(2*T[T.length-1]);var R=T.length,I=T[R-1];function P(e){return("number"==typeof e||"string"==typeof e)&&+Math.abs(e)<=t||e instanceof a&&e.value.length<=1}function x(e,t,r){t=K(t);for(var i=e.isNegative(),n=t.isNegative(),o=i?e.not():e,a=n?t.not():t,s=0,c=0,u=null,f=null,h=[];!o.isZero()||!a.isZero();)s=(u=A(o,I))[1].toJSNumber(),i&&(s=I-1-s),c=(f=A(a,I))[1].toJSNumber(),n&&(c=I-1-c),o=u[0],a=f[0],h.push(r(s,c));for(var l=0!==r(i?1:0,n?1:0)?bigInt(-1):bigInt(0),_=h.length-1;_>=0;_-=1)l=l.multiply(I).add(bigInt(h[_]));return l}a.prototype.shiftLeft=function(e){if(!P(e))throw new Error(String(e)+" is too large for shifting.");if((e=+e)<0)return this.shiftRight(-e);var t=this;if(t.isZero())return t;for(;e>=R;)t=t.multiply(I),e-=R-1;return t.multiply(T[e])},s.prototype.shiftLeft=a.prototype.shiftLeft,a.prototype.shiftRight=function(e){var t;if(!P(e))throw new Error(String(e)+" is too large for shifting.");if((e=+e)<0)return this.shiftLeft(-e);for(var r=this;e>=R;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;r=(t=A(r,I))[1].isNegative()?t[0].prev():t[0],e-=R-1}return(t=A(r,T[e]))[1].isNegative()?t[0].prev():t[0]},s.prototype.shiftRight=a.prototype.shiftRight,a.prototype.not=function(){return this.negate().prev()},s.prototype.not=a.prototype.not,a.prototype.and=function(e){return x(this,e,(function(e,t){return e&t}))},s.prototype.and=a.prototype.and,a.prototype.or=function(e){return x(this,e,(function(e,t){return e|t}))},s.prototype.or=a.prototype.or,a.prototype.xor=function(e){return x(this,e,(function(e,t){return e^t}))},s.prototype.xor=a.prototype.xor;function O(e){var r=e.value,i="number"==typeof r?r|1<<30:r[0]+r[1]*t|1073758208;return i&-i}function C(e,t){return e=K(e),t=K(t),e.greater(t)?e:t}function N(e,t){return e=K(e),t=K(t),e.lesser(t)?e:t}function L(e,t){if(e=K(e).abs(),t=K(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var r,i,n=o[1];e.isEven()&&t.isEven();)r=Math.min(O(e),O(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(O(e));do{for(;t.isEven();)t=t.divide(O(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}a.prototype.bitLength=function(){var e=this;return e.compareTo(bigInt(0))<0&&(e=e.negate().subtract(bigInt(1))),0===e.compareTo(bigInt(0))?bigInt(0):bigInt(function e(t,r){if(r.compareTo(t)<=0){var i=e(t,r.square(r)),n=i.p,o=i.e,a=n.multiply(r);return a.compareTo(t)<=0?{p:a,e:2*o+1}:{p:n,e:2*o}}return{p:bigInt(1),e:0}}(e,bigInt(2)).e).add(bigInt(1))},s.prototype.bitLength=a.prototype.bitLength;var D=function(e,t){for(var r=e.length,i=Math.abs(t),o=0;o=i){if("1"===f&&1===i)continue;throw new Error(f+" is not a valid digit in base "+t+".")}if(f.charCodeAt(0)-87>=i)throw new Error(f+" is not a valid digit in base "+t+".")}if(2<=t&&t<=36&&r<=n/Math.log(t)){var a=parseInt(e,t);if(isNaN(a))throw new Error(f+" is not a valid digit in base "+t+".");return new s(parseInt(e,t))}t=K(t);var c=[],u="-"===e[0];for(o=u?1:0;o"!==e[o]);c.push(K(e.slice(l+1,o)))}}return U(c,t,u)};function U(e,t,r){var i,n=o[0],a=o[1];for(i=e.length-1;i>=0;i--)n=n.add(e[i].times(a)),a=a.times(t);return r?n.negate():n}function H(e){return e<=35?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e):"<"+e+">"}function j(e,t){if((t=bigInt(t)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e)).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(+e-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.equals(1))return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(+e)).map(Number.prototype.valueOf,1),isNegative:i};for(var n,o=[],a=e;a.isNegative()||a.compareAbs(t)>=0;){n=a.divmod(t),a=n.quotient;var s=n.remainder;s.isNegative()&&(s=t.minus(s).abs(),a=a.next()),o.push(s.toJSNumber())}return o.push(a.toJSNumber()),{value:o.reverse(),isNegative:i}}function z(e,t){var r=j(e,t);return(r.isNegative?"-":"")+r.value.map(H).join("")}function q(e){if(c(+e)){var t=+e;if(t===_(t))return new s(t);throw new Error("Invalid integer: "+e)}var r="-"===e[0];r&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(2===i.length){var n=i[1];if("+"===n[0]&&(n=n.slice(1)),(n=+n)!==_(n)||!c(n))throw new Error("Invalid integer: "+n+" is not a valid exponent.");var o=i[0],u=o.indexOf(".");if(u>=0&&(n-=o.length-u-1,o=o.slice(0,u)+o.slice(u+1)),n<0)throw new Error("Cannot include negative exponent part for integers");e=o+=new Array(n+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);for(var f=[],l=e.length,d=l-7;l>0;)f.push(+e.slice(d,l)),(d-=7)<0&&(d=0),l-=7;return h(f),new a(f,r)}function K(e){return"number"==typeof e?function(e){if(c(e)){if(e!==_(e))throw new Error(e+" is not an integer.");return new s(e)}return q(e.toString())}(e):"string"==typeof e?q(e):e}a.prototype.toArray=function(e){return j(this,e)},s.prototype.toArray=function(e){return j(this,e)},a.prototype.toString=function(e){if(void 0===e&&(e=10),10!==e)return z(this,e);for(var t,r=this.value,i=r.length,n=String(r[--i]);--i>=0;)t=String(r[i]),n+="0000000".slice(t.length)+t;return(this.sign?"-":"")+n},s.prototype.toString=function(e){return void 0===e&&(e=10),10!=e?z(this,e):String(this.value)},a.prototype.toJSON=s.prototype.toJSON=function(){return this.toString()},a.prototype.valueOf=function(){return parseInt(this.toString(),10)},a.prototype.toJSNumber=a.prototype.valueOf,s.prototype.valueOf=function(){return this.value},s.prototype.toJSNumber=s.prototype.valueOf;for(var F=0;F<1e3;F++)o[F]=new s(F),F>0&&(o[-F]=new s(-F));return o.one=o[1],o.zero=o[0],o.minusOne=o[-1],o.max=C,o.min=N,o.gcd=L,o.lcm=function(e,t){return e=K(e).abs(),t=K(t).abs(),e.divide(L(e,t)).multiply(t)},o.isInstance=function(e){return e instanceof a||e instanceof s},o.randBetween=function(e,r){var i=N(e=K(e),r=K(r)),n=C(e,r).subtract(i).add(1);if(n.isSmall)return i.add(Math.floor(Math.random()*n));for(var o=[],c=!0,u=n.value.length-1;u>=0;u--){var h=c?n.value[u]:t,l=_(Math.random()*h);o.unshift(l),l>t==0,"Invalid value: "+h+"."),c=c<=r;)u-=r,a[s]=c>>u&o,++s}return i?__validate_327(u0&&(a[s]=c<=t?i(void 0,o-n,o):(e.next(),void a()))}))}()},_$account_7={};function Account(e){this.chains=e}Account.fromJSON=function(e,t,r){},Account.prototype.clone=function(){return new Account(this.chains.map((function(e){return e.clone()})))},Account.prototype.containsAddress=function(e){return this.chains.some((function(t){return void 0!==t.find(e)}))},Account.prototype.derive=function(e,t){let r;return this.chains.some((function(i,n){return r=i.derive(e,t&&t[n])})),r},Account.prototype.discoverChain=function(e,t,r,i){const n=this.chains,o=n[e].clone();_$discovery_9(o,t,r,(function(t,r,a){if(t)return i(t);const s=a-r;for(let e=1;e>t==0,"Invalid value: "+h+"."),c=c<=r;)u-=r,a[s]=c>>u&o,++s}return i?__validate_272(u0&&(a[s]=c<new _$bip32Utils_10.Chain(e.neutered()));return new _$bip32Utils_10.Account(t)}createChain(e){return new _$bip32Utils_10.Chain(e)}};const SEQUENCE_FINAL=4294967295,SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,SEQUENCE_LOCKTIME_GRANULARITY=9,SEQUENCE_LOCKTIME_MASK=65535,SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,BLOCKS_MAX=SEQUENCE_LOCKTIME_MASK,SECONDS_MOD=1<SECONDS_MAX)throw new TypeError("Expected Number seconds <= "+SECONDS_MAX);if(r%SECONDS_MOD!=0)throw new TypeError("Expected Number seconds as a multiple of "+SECONDS_MOD);return SEQUENCE_LOCKTIME_TYPE_FLAG|r>>SEQUENCE_LOCKTIME_GRANULARITY}if(!Number.isFinite(t))throw new TypeError("Expected Number blocks");if(t>SEQUENCE_LOCKTIME_MASK)throw new TypeError("Expected Number blocks <= "+BLOCKS_MAX);return t}};class __TransactionBuilder_40{static setAddress(e){__TransactionBuilder_40._address=e}constructor(e="mainnet"){let t;const r=(t="bitcoincash"===e||"mainnet"===e?_$coininfo_86.bitcoincash.main:_$coininfo_86.bitcoincash.test).toBitcoinJS();this.transaction=new _$src_55.TransactionBuilder(r),this.DEFAULT_SEQUENCE=4294967295,this.hashTypes={SIGHASH_ALL:1,SIGHASH_NONE:2,SIGHASH_SINGLE:3,SIGHASH_ANYONECANPAY:128,SIGHASH_BITCOINCASH_BIP143:64,ADVANCED_TRANSACTION_MARKER:0,ADVANCED_TRANSACTION_FLAG:1},this.signatureAlgorithms={ECDSA:_$src_55.ECSignature.ECDSA,SCHNORR:_$src_55.ECSignature.SCHNORR},this.bip66=_$bip66_212,this.bip68=_$bcBip68_151,this.p2shInput=!1}addInput(e,t,r=this.DEFAULT_SEQUENCE,i){this.transaction.addInput(e,t,r,i)}addInputScript(e,t){this.tx=this.transaction.buildIncomplete(),this.tx.setInputScript(e,t),this.p2shInput=!0}addInputScripts(e){this.tx=this.transaction.buildIncomplete(),e.forEach(e=>{this.tx.setInputScript(e.vout,e.script)}),this.p2shInput=!0}addOutput(e,t){try{this.transaction.addOutput(__TransactionBuilder_40._address.toLegacyAddress(e),t)}catch(r){this.transaction.addOutput(e,t)}}setLockTime(e){this.transaction.setLockTime(e)}sign(e,t,r,i=this.hashTypes.SIGHASH_ALL,n,o){this.transaction.sign(e,t,r,i,n,void 0,o)}build(){return!0===this.p2shInput?this.tx:this.transaction.build()}}var _$TransactionBuilder_40=__TransactionBuilder_40;class __ECPair_22{static setAddress(e){__ECPair_22._address=e}static fromWIF(e){let t,r;"L"===e[0]||"K"===e[0]?t="mainnet":"c"===e[0]&&(t="testnet");const i=(r="mainnet"===t?_$coininfo_86.bitcoincash.main:_$coininfo_86.bitcoincash.test).toBitcoinJS();return _$src_55.ECPair.fromWIF(e,i)}static toWIF(e){return e.toWIF()}static sign(e,t){return e.sign(t)}static verify(e,t,r){return e.verify(t,r)}static fromPublicKey(e){return _$src_55.ECPair.fromPublicKeyBuffer(e)}static toPublicKey(e){return e.getPublicKeyBuffer()}static toLegacyAddress(e){return e.getAddress()}static toCashAddress(e,t=!1){return __ECPair_22._address.toCashAddress(e.getAddress(),!0,t)}}var _$ECPair_22=__ECPair_22,_$script_33=class{constructor(){this.opcodes=_$index_45,this.nullData=_$src_55.script.nullData,this.multisig={input:{encode:e=>{const t=[];return e.forEach(e=>{t.push(e)}),_$src_55.script.multisig.input.encode(t)},decode:_$src_55.script.multisig.input.decode,check:_$src_55.script.multisig.input.check},output:{encode:(e,t)=>{const r=[];return t.forEach(e=>{r.push(e)}),_$src_55.script.multisig.output.encode(e,r)},decode:_$src_55.script.multisig.output.decode,check:_$src_55.script.multisig.output.check}},this.pubKey=_$src_55.script.pubKey,this.pubKeyHash=_$src_55.script.pubKeyHash,this.scriptHash=_$src_55.script.scriptHash}classifyInput(e){return _$src_55.script.classifyInput(e)}classifyOutput(e){return _$src_55.script.classifyOutput(e)}decode(e){return _$src_55.script.decompile(e)}encode(e){const t=[];return e.forEach(e=>{t.push(e)}),_$src_55.script.compile(t)}encode2(e){const t=[];return e.forEach(e=>{t.push(e)}),_$src_55.script.compile2(t)}toASM(e){return _$src_55.script.toASM(e)}fromASM(e){return _$src_55.script.fromASM(e)}},_$price_29=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},this.axios=_$axios_119}async current(e="usd"){try{return(await this.axios.get("https://index-api.bitcoin.com/api/v0/cash/price/"+e.toLowerCase())).data.price}catch(err){throw err.response&&err.response.data?err.response.data:err}}async getUsd(){try{return(await this.axios.get(this.restURL+"price/usd",this.axiosOptions)).data.usd}catch(err){throw err.response&&err.response.data?err.response.data:err}}async rates(){try{return(await this.axios.get(this.restURL+"price/rates",this.axiosOptions)).data}catch(err){throw err.response&&err.response.data?err.response.data:err}}async getBchaUsd(){try{return 1e6*(await this.axios.get(this.restURL+"price/bchausd",this.axiosOptions)).data.usd}catch(err){throw err.response&&err.response.data?err.response.data:err}}async getXecUsd(){try{return(await this.axios.get(this.restURL+"price/bchausd",this.axiosOptions)).data.usd}catch(err){throw err.response&&err.response.data?err.response.data:err}}async getBchUsd(){try{return(await this.axios.get(this.restURL+"price/bchusd",this.axiosOptions)).data.usd}catch(err){throw err.response&&err.response.data?err.response.data:err}}},_$randomBytes_420={};(function(t){(function(){"use strict";var r=_$cryptoBrowserify_280({}),i=r.randomBytes===r.pseudoRandomBytes?1:3;function n(e,t,i){r.randomBytes(e,(function(r,o){return r?--t?void setTimeout(n.bind(null,e,t,i),10):i(r):i(null,o)}))}(_$randomBytes_420=function(e,r){if(void 0!==r&&"function"!=typeof r)throw new TypeError("argument callback must be a function");if(!r&&!t.Promise)throw new TypeError("argument callback is required");return r?n(e,i,r):new Promise((function(t,r){n(e,i,(function(e,i){if(e)return r(e);t(i)}))}))}).sync=function(t){for(var n=null,o=0;o0)throw new Error(e+" must be an integer in the range 1..n-1")}var _$check_195={checkSessionParams:function(e,t,r,i,n){checkSignParams(t,r),checkBuffer("sessionId",e,32),checkBuffer("pubKeyCombined",i,33),checkBuffer("ell",n,32)},checkSignParams:checkSignParams,checkVerifyParams:function(e,t,r){checkBuffer("pubKey",e,33),checkBuffer("message",t,32),checkBuffer("signature",r,64)},checkBatchVerifyParams:function(e,t,r){if(checkPubKeyArr(e),function(e){checkArray("messages",e);for(let t=0;t=0)throw new Error("r is larger than or equal to field size");if(t.compareTo(n)>=0)throw new Error("s is larger than or equal to curve order")},checkPointExists:function(e,t){if(t.curve.isInfinity(t))throw new Error("point is at infinity");if(e!==t.affineY.isEven())throw new Error("point does not exist")},checkPubKeyArr:checkPubKeyArr,checkPubKeysUnique:function(e){const t=e.map(e=>e.toString("hex"));if(e.length!==t.filter((e,t,r)=>r.indexOf(e)===t).length)throw new Error("pubKeys must be an array with unique elements")},checkArray:checkArray,checkNonceArr:function(e){checkArray("nonces",e);for(let t=0;t>6,a[c++]=128|63&o):o<55296||o>=57344?(a[c++]=224|o>>12,a[c++]=128|o>>6&63,a[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),a[c++]=240|o>>18,a[c++]=128|o>>12&63,a[c++]=128|o>>6&63,a[c++]=128|63&o);e=a}else{if("object"!==n)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],f=[];for(i=0;i<64;++i){var h=e[i]||0;u[i]=92^h,f[i]=54^h}Sha256.call(this,t,r),this.update(f),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var i,n,o=0,a=e.length,s=this.blocks;o>2]|=e[o]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.block=s[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,i,n,o,a,s,c,u=this.h0,f=this.h1,h=this.h2,l=this.h3,_=this.h4,d=this.h5,p=this.h6,m=this.h7,b=this.blocks;for(e=16;e<64;++e)t=((n=b[e-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,r=((n=b[e-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,b[e]=b[e-16]+t+b[e-7]+r<<0;for(c=f&h,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,m=(n=b[0]-1413257819)-150054599<<0,l=n+24177077<<0):(o=704751109,m=(n=b[0]-210244248)-1521486534<<0,l=n+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(o=u&f)^u&h^c,m=l+(n=m+(r=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&d^~_&p)+K[e]+b[e])<<0,l=n+(t+i)<<0),t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(a=l&u)^l&f^o,p=h+(n=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&_^~m&d)+K[e+1]+b[e+1])<<0,t=((h=n+(t+i)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(s=h&l)^h&u^a,d=f+(n=d+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&_)+K[e+2]+b[e+2])<<0,t=((f=n+(t+i)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),i=(c=f&h)^f&l^s,_=u+(n=_+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&m)+K[e+3]+b[e+3])<<0,u=n+(t+i)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+f<<0,this.h2=this.h2+h<<0,this.h3=this.h3+l<<0,this.h4=this.h4+_<<0,this.h5=this.h5+d<<0,this.h6=this.h6+p<<0,this.h7=this.h7+m<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,o=this.h5,a=this.h6,s=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(c+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,o=this.h5,a=this.h6,s=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||c.push(s>>24&255,s>>16&255,s>>8&255,255&s),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?_$sha256_390.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define((function(){return exports})))}()}).call(this)}).call(this,_$browser_408,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$sha256_390=_$sha256_390.exports;const __Buffer_196=_$safeBuffer_424.Buffer,__curve_196=_$lib_331.getCurveByName("secp256k1");function bufferToInt(e){return _$lib_192.fromBuffer(e)}var _$convert_196={bufferToInt:bufferToInt,intToBuffer:function(e){return e.toBuffer(32)},hash:function(e){return __Buffer_196.from(_$sha256_390.create().update(e).array())},pointToBuffer:function(e){return e.getEncoded(!0)},pubKeyToPoint:function(e){const t=e[0]-2==0,r=bufferToInt(e.slice(1,33)),i=__curve_196.pointFromX(!t,r);return _$check_195.checkPointExists(t,i),i}};const __Buffer_198=_$safeBuffer_424.Buffer,__curve_198=_$lib_331.getCurveByName("secp256k1"),__concat_198=__Buffer_198.concat,__G_198=__curve_198.G,__p_198=__curve_198.p,__n_198=__curve_198.n,__one_198=_$lib_192.ONE,__two_198=_$lib_192.valueOf(2);function jacobi(e){return e.modPow(__p_198.subtract(__one_198).divide(__two_198),__p_198).intValue()}var _$math_198={deterministicGetK0:function(e,t){_$check_195.checkSignParams(e,t);const r=_$convert_196.hash(__concat_198([_$convert_196.intToBuffer(e),t])),i=_$convert_196.bufferToInt(r).mod(__n_198);if(0===i.signum())throw new Error("k0 is zero");return i},jacobi:jacobi,getK:function(e,t){return 1===jacobi(e.affineY)?t:__n_198.subtract(t)},getE:function(e,t,r){return _$convert_196.bufferToInt(_$convert_196.hash(__concat_198([e,_$convert_196.pointToBuffer(t),r]))).mod(__n_198)},getR:function(e,t,r){const i=__G_198.multiply(e),n=r.multiply(t);return i.add(n.negate())},randomA:function(){let t=null;for(;;){t=_$convert_196.bufferToInt(__Buffer_198.from(_$randomBytes_420.sync(32)));try{return _$check_195.checkRange("a",t),t}catch(e){}}}};const __Buffer_200=_$safeBuffer_424.Buffer,__curve_200=_$lib_331.getCurveByName("secp256k1"),__concat_200=__Buffer_200.concat,__G_200=__curve_200.G,__p_200=__curve_200.p,__n_200=__curve_200.n,zero=_$lib_192.ZERO,__one_200=_$lib_192.ONE,__two_200=_$lib_192.valueOf(2),three=_$lib_192.valueOf(3),four=_$lib_192.valueOf(4),seven=_$lib_192.valueOf(7);var _$schnorr_200={sign:function(e,t){const r=_$math_198.deterministicGetK0(e,t),i=__G_200.multiply(r),n=_$math_198.getK(i,r),o=__G_200.multiply(e),a=_$convert_196.intToBuffer(i.affineX),s=_$math_198.getE(a,o,t);return __concat_200([a,_$convert_196.intToBuffer(n.add(s.multiply(e)).mod(__n_200))])},verify:function(e,t,r){_$check_195.checkVerifyParams(e,t,r);const i=_$convert_196.pubKeyToPoint(e),n=_$convert_196.bufferToInt(r.slice(0,32)),o=_$convert_196.bufferToInt(r.slice(32,64));_$check_195.checkSignatureInput(n,o);const a=_$math_198.getE(_$convert_196.intToBuffer(n),i,t),s=_$math_198.getR(o,a,i);if(s.curve.isInfinity(s)||1!==_$math_198.jacobi(s.affineY)||!s.affineX.equals(n))throw new Error("signature verification failed")},batchVerify:function(e,t,r){_$check_195.checkBatchVerifyParams(e,t,r);let i=zero,n=null;for(let o=0;o0||e===t?t:t-1}function h(e){for(var t,r,i=1,n=e.length,o=e[0]+"";iu^r?1:-1;for(s=(c=n.length)<(u=o.length)?c:u,a=0;ao[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function _(e,t,r,i){if(er||e!==n(e))throw Error(o+(i||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function d(e){var t=e.c.length-1;return f(e.e/14)==t&&e.c[t]%2!=0}function p(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function m(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(i=e.length)){for(n=r,t-=i;--t;n+=r);e+=n}else tx?d.c=d.e=null:e.e=10;u/=10,c++);return void(c>x?d.c=d.e=null:(d.e=c,d.c=[e]))}l=String(e)}else{if(!r.test(l=String(e)))return y(d,l,f);d.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(c=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(c<0&&(c=u),c+=+l.slice(u+1),l=l.substring(0,u)):c<0&&(c=l.length)}else{if(_(t,2,D.length,"Base"),10==t)return q(d=new U(e),M+d.e+1,T);if(l=String(e),f="number"==typeof e){if(0*e!=0)return y(d,l,f,t);if(d.s=1/e<0?(l=l.slice(1),-1):1,U.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else d.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(i=D.slice(0,t),c=u=0,h=l.length;uc){c=h;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,c=0;continue}return y(d,String(e),f,t)}f=!1,(c=(l=g(l,t,10,d.s)).indexOf("."))>-1?l=l.replace(".",""):c=l.length}for(u=0;48===l.charCodeAt(u);u++);for(h=l.length;48===l.charCodeAt(--h););if(l=l.slice(u,++h)){if(h-=u,f&&U.DEBUG&&h>15&&(e>9007199254740991||e!==n(e)))throw Error(a+d.s*e);if((c=c-u-1)>x)d.c=d.e=null;else if(c=I)?p(c,a):m(c,a,"0");else if(o=(e=q(new U(e),t,r)).e,s=(c=h(e.c)).length,1==i||2==i&&(t<=o||o<=R)){for(;ss){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function j(e,t){for(var r,i=1,n=new U(e[0]);i=10;n/=10,i++);return(r=i+14*r-1)>x?e.c=e.e=null:r=10;h/=10,a++);if((u=t-a)<0)u+=14,f=t,d=(l=p[_=0])/m[a-f-1]%10|0;else if((_=i((u+1)/14))>=p.length){if(!o)break e;for(;p.length<=_;p.push(0));l=d=0,a=1,f=(u%=14)-14+1}else{for(l=h=p[_],a=1;h>=10;h/=10,a++);d=(f=(u%=14)-14+a)<0?0:l/m[a-f-1]%10|0}if(o=o||t<0||null!=p[_+1]||(f<0?l:l%m[a-f-1]),o=r<4?(d||o)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||o||6==r&&(u>0?f>0?l/m[a-f]:0:p[_-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,o?(t-=e.e+1,p[0]=m[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==u?(p.length=_,h=1,_--):(p.length=_+1,h=m[14-u],p[_]=f>0?n(l/m[a-f]%m[f])*h:0),o)for(;;){if(0==_){for(u=1,f=p[0];f>=10;f/=10,u++);for(f=p[0]+=h,h=1;f>=10;f/=10,h++);u!=h&&(e.e++,p[0]==s&&(p[0]=1));break}if(p[_]+=h,p[_]!=s)break;p[_--]=0,h=1}for(u=p.length;0===p[--u];p.pop());}e.e>x?e.c=e.e=null:e.e=I?p(t,r):m(t,r,"0"),e.s<0?"-"+t:t)}return U.clone=e,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,u,t),M=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),T=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-u,0,t),_(r[1],0,u,t),R=r[0],I=r[1]):(_(r,-u,u,t),R=-(I=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-u,-1,t),_(r[1],1,u,t),P=r[0],x=r[1];else{if(_(r,-u,u,t),!r)throw Error(o+t+" cannot be zero: "+r);P=-(x=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(o+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw O=!r,Error(o+"crypto unavailable");O=r}else O=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),C=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,u,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(o+t+" not an object: "+r);L=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);D=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:T,EXPONENTIAL_AT:[R,I],RANGE:[P,x],CRYPTO:O,MODULO_MODE:C,POW_PRECISION:N,FORMAT:L,ALPHABET:D}},U.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!U.DEBUG)return!0;var t,r,i=e.c,a=e.e,c=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===c||-1===c)&&a>=-u&&a<=u&&a===n(a)){if(0===i[0]){if(0===a&&1===i.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(i[0]).length==t){for(t=0;t=s||r!==n(r))break e;if(0!==r)return!0}}}else if(null===i&&null===a&&(null===c||1===c||-1===c))return!0;throw Error(o+"Invalid BigNumber: "+e)},U.maximum=U.max=function(){return j(arguments,B.lt)},U.minimum=U.min=function(){return j(arguments,B.gt)},U.random=(v=9007199254740992*Math.random()&2097151?function(){return n(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,a,s,f,h=0,l=[],d=new U(k);if(null==e?e=M:_(e,0,u),s=i(e/14),O)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));h>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[h]=r[0],t[h+1]=r[1]):(l.push(f%1e14),h+=2);h=s/2}else{if(!crypto.randomBytes)throw O=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);h=9e15?crypto.randomBytes(7).copy(t,h):(l.push(f%1e14),h+=7);h=s/7}if(!O)for(;h=10;f/=10,h++);h<14&&(a-=14-h)}return d.e=a,d.c=l,d}),U.sum=function(){for(var e=1,t=arguments,r=new U(t[0]);er-1&&(null==a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}return function(t,r,i,n,o){var a,s,c,u,f,l,_,d,p=t.indexOf("."),g=M,y=T;for(p>=0&&(u=N,N=0,t=t.replace(".",""),l=(d=new U(r)).pow(t.length-p),N=u,d.c=e(m(h(l.c),l.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=u=(_=e(t,r,i,o?(a=D,"0123456789"):(a="0123456789",D))).length;0==_[--u];_.pop());if(!_[0])return a.charAt(0);if(p<0?--c:(l.c=_,l.e=c,l.s=n,_=(l=b(l,d,g,y,i)).c,f=l.r,c=l.e),p=_[s=c+g+1],u=i/2,f=f||s<0||null!=_[s+1],f=y<4?(null!=p||f)&&(0==y||y==(l.s<0?3:2)):p>u||p==u&&(4==y||f||6==y&&1&_[s-1]||y==(l.s<0?8:7)),s<1||!_[0])t=f?m(a.charAt(1),-g,a.charAt(0)):a.charAt(0);else{if(_.length=s,f)for(--i;++_[--s]>i;)_[s]=0,s||(++c,_=[1].concat(_));for(u=_.length;!_[--u];);for(p=0,t="";p<=u;t+=a.charAt(_[p++]));t=m(t,c,a.charAt(0))}return t}}(),b=function(){function e(e,t,r){var i,n,o,a,s=0,c=e.length,u=t%1e7,f=t/1e7|0;for(e=e.slice();c--;)s=((n=u*(o=e[c]%1e7)+(i=f*o+(a=e[c]/1e7|0)*u)%1e7*1e7+s)/r|0)+(i/1e7|0)+f*a,e[c]=n%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,i){var n,o;if(r!=i)o=r>i?1:-1;else for(n=o=0;nt[n]?1:-1;break}return o}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r]1;e.splice(0,1));}return function(i,o,a,c,u){var h,l,_,d,p,m,b,g,y,v,w,$,E,S,A,B,k,M=i.s==o.s?1:-1,T=i.c,R=o.c;if(!(T&&T[0]&&R&&R[0]))return new U(i.s&&o.s&&(T?!R||T[0]!=R[0]:R)?T&&0==T[0]||!R?0*M:M/0:NaN);for(y=(g=new U(M)).c=[],M=a+(l=i.e-o.e)+1,u||(u=s,l=f(i.e/14)-f(o.e/14),M=M/14|0),_=0;R[_]==(T[_]||0);_++);if(R[_]>(T[_]||0)&&l--,M<0)y.push(1),d=!0;else{for(S=T.length,B=R.length,_=0,M+=2,(p=n(u/(R[0]+1)))>1&&(R=e(R,p,u),T=e(T,p,u),B=R.length,S=T.length),E=B,w=(v=T.slice(0,B)).length;w=u/2&&A++;do{if(p=0,(h=t(R,v,B,w))<0){if($=v[0],B!=w&&($=$*u+(v[1]||0)),(p=n($/A))>1)for(p>=u&&(p=u-1),b=(m=e(R,p,u)).length,w=v.length;1==t(m,v,b,w);)p--,r(m,B=10;M/=10,_++);q(g,a+(g.e=_+14*l-1)+1,c,d)}else g.e=l,g.r=+d;return g}}(),w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,E=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g,y=function(e,t,r,i){var n,a=r?t:t.replace(A,"");if(S.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(w,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?e:t})),i&&(n=i,a=a.replace($,"$1").replace(E,"0.$1")),t!=a))return new U(a,n);if(U.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},B.absoluteValue=B.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return l(this,new U(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,i,n,o=this;if(null!=e)return _(e,0,u),null==t?t=T:_(t,0,8),q(new U(o),e+o.e+1,t);if(!(r=o.c))return null;if(i=14*((n=r.length-1)-f(this.e/14)),n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},B.dividedBy=B.div=function(e,t){return b(this,new U(e,t),M,T)},B.dividedToIntegerBy=B.idiv=function(e,t){return b(this,new U(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,a,s,c,u,f,h,l,_=this;if((e=new U(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+K(e));if(null!=t&&(t=new U(t)),u=e.e>14,!_.c||!_.c[0]||1==_.c[0]&&!_.e&&1==_.c.length||!e.c||!e.c[0])return l=new U(Math.pow(+K(_),u?2-d(e):+K(e))),t?l.mod(t):l;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new U(NaN);(a=!f&&_.isInteger()&&t.isInteger())&&(_=_.mod(t))}else{if(e.e>9&&(_.e>0||_.e<-1||(0==_.e?_.c[0]>1||u&&_.c[1]>=24e7:_.c[0]<8e13||u&&_.c[0]<=9999975e7)))return c=_.s<0&&d(e)?-0:0,_.e>-1&&(c=1/c),new U(f?1/c:c);N&&(c=i(N/14+2))}for(u?(r=new U(.5),f&&(e.s=1),h=d(e)):h=(s=Math.abs(+K(e)))%2,l=new U(k);;){if(h){if(!(l=l.times(_)).c)break;c?l.c.length>c&&(l.c.length=c):a&&(l=l.mod(t))}if(s){if(0===(s=n(s/2)))break;h=s%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)h=d(e);else{if(0==(s=+K(e)))break;h=s%2}_=_.times(_),c?_.c&&_.c.length>c&&(_.c.length=c):a&&(_=_.mod(t))}return a?l:(f&&(l=k.div(l)),t?l.mod(t):c?q(l,N,T,void 0):l)},B.integerValue=function(e){var t=new U(this);return null==e?e=T:_(e,0,8),q(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===l(this,new U(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return l(this,new U(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=l(this,new U(e,t)))||0===t},B.isInteger=function(){return!!this.c&&f(this.e/14)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return l(this,new U(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=l(this,new U(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,i,n,o,a=this,c=a.s;if(t=(e=new U(e,t)).s,!c||!t)return new U(NaN);if(c!=t)return e.s=-t,a.plus(e);var u=a.e/14,h=e.e/14,l=a.c,_=e.c;if(!u||!h){if(!l||!_)return l?(e.s=-t,e):new U(_?a:NaN);if(!l[0]||!_[0])return _[0]?(e.s=-t,e):new U(l[0]?a:3==T?-0:0)}if(u=f(u),h=f(h),l=l.slice(),c=u-h){for((o=c<0)?(c=-c,n=l):(h=u,n=_),n.reverse(),t=c;t--;n.push(0));n.reverse()}else for(i=(o=(c=l.length)<(t=_.length))?c:t,c=t=0;t0)for(;t--;l[r++]=0);for(t=s-1;i>c;){if(l[--i]<_[i]){for(r=i;r&&!l[--r];l[r]=t);--l[r],l[i]+=s}l[i]-=_[i]}for(;0==l[0];l.splice(0,1),--h);return l[0]?z(e,l,h):(e.s=3==T?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var r,i,n=this;return e=new U(e,t),!n.c||!e.s||e.c&&!e.c[0]?new U(NaN):!e.c||n.c&&!n.c[0]?new U(n):(9==C?(i=e.s,e.s=1,r=b(n,e,0,3),e.s=i,r.s*=i):r=b(n,e,0,C),(e=n.minus(r.times(e))).c[0]||1!=C||(e.s=n.s),e)},B.multipliedBy=B.times=function(e,t){var r,i,n,o,a,c,u,h,l,_,d,p,m,b,g=this,y=g.c,v=(e=new U(e,t)).c;if(!(y&&v&&y[0]&&v[0]))return!g.s||!e.s||y&&!y[0]&&!v||v&&!v[0]&&!y?e.c=e.e=e.s=null:(e.s*=g.s,y&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(i=f(g.e/14)+f(e.e/14),e.s*=g.s,(u=y.length)<(_=v.length)&&(m=y,y=v,v=m,n=u,u=_,_=n),n=u+_,m=[];n--;m.push(0));for(b=s,1e7,n=_;--n>=0;){for(r=0,d=v[n]%1e7,p=v[n]/1e7|0,o=n+(a=u);o>n;)r=((h=d*(h=y[--a]%1e7)+(c=p*h+(l=y[a]/1e7|0)*d)%1e7*1e7+m[o]+r)/b|0)+(c/1e7|0)+p*l,m[o--]=h%b;m[o]=r}return r?++i:m.splice(0,1),z(e,m,i)},B.negated=function(){var e=new U(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,i=this,n=i.s;if(t=(e=new U(e,t)).s,!n||!t)return new U(NaN);if(n!=t)return e.s=-t,i.minus(e);var o=i.e/14,a=e.e/14,c=i.c,u=e.c;if(!o||!a){if(!c||!u)return new U(n/0);if(!c[0]||!u[0])return u[0]?e:new U(c[0]?i:0*n)}if(o=f(o),a=f(a),c=c.slice(),n=o-a){for(n>0?(a=o,r=u):(n=-n,r=c),r.reverse();n--;r.push(0));r.reverse()}for((n=c.length)-(t=u.length)<0&&(r=u,u=c,c=r,t=n),n=0;t;)n=(c[--t]=c[t]+u[t]+n)/s|0,c[t]=s===c[t]?0:c[t]%s;return n&&(c=[n].concat(c),++a),z(e,c,a)},B.precision=B.sd=function(e,t){var r,i,n,o=this;if(null!=e&&e!==!!e)return _(e,1,u),null==t?t=T:_(t,0,8),q(new U(o),e,t);if(!(r=o.c))return null;if(i=14*(n=r.length-1)+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&o.e+1>i&&(i=o.e+1),i},B.shiftedBy=function(e){return _(e,-9007199254740991,9007199254740991),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,r,i,n,o=this,a=o.c,s=o.s,c=o.e,u=M+4,l=new U("0.5");if(1!==s||!a||!a[0])return new U(!s||s<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(s=Math.sqrt(+K(o)))||s==1/0?(((t=h(a)).length+c)%2==0&&(t+="0"),s=Math.sqrt(+t),c=f((c+1)/2)-(c<0||c%2),r=new U(t=s==1/0?"1e"+c:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new U(s+""),r.c[0])for((s=(c=r.e)+u)<3&&(s=0);;)if(n=r,r=l.times(n.plus(b(o,n,u,1))),h(n.c).slice(0,s)===(t=h(r.c)).slice(0,s)){if(r.e0&&p>0){for(a=p%c||c,h=d.substr(0,a);a0&&(h+=f+d.slice(a)),_&&(h="-"+h)}i=l?h+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+i+(r.suffix||"")},B.toFraction=function(e){var t,r,i,n,a,s,u,f,l,_,d,p,m=this,g=m.c;if(null!=e&&(!(u=new U(e)).isInteger()&&(u.c||1!==u.s)||u.lt(k)))throw Error(o+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+K(u));if(!g)return new U(m);for(t=new U(k),l=r=new U(k),i=f=new U(k),p=h(g),a=t.e=p.length-m.e-1,t.c[0]=c[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=x,x=1/0,u=new U(p),f.c[0]=0;_=b(u,t,0,1),1!=(n=r.plus(_.times(i))).comparedTo(e);)r=i,i=n,l=f.plus(_.times(n=l)),f=n,t=u.minus(_.times(n=t)),u=n;return n=b(e.minus(r),i,0,1),f=f.plus(n.times(l)),r=r.plus(n.times(i)),f.s=l.s=m.s,d=b(l,i,a*=2,T).minus(m).abs().comparedTo(b(f,r,a,T).minus(m).abs())<1?[l,i]:[f,r],x=s,d},B.toNumber=function(){return+K(this)},B.toPrecision=function(e,t){return null!=e&&_(e,1,u),H(this,e,t,2)},B.toString=function(e){var t,r=this,i=r.s,n=r.e;return null===n?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=n<=R||n>=I?p(h(r.c),n):m(h(r.c),n,"0"):10===e?t=m(h((r=q(new U(r),M+n+1,T)).c),r.e,"0"):(_(e,2,D.length,"Base"),t=g(m(h(r.c),n,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return K(this)},B._isBigNumber=!0,null!=t&&U.set(t),U}()).default=t.BigNumber=t,"function"==typeof define&&define.amd?define((function(){return t})):_$bignumber_11.exports?_$bignumber_11.exports=t:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=t)}(this),_$bignumber_11=_$bignumber_11.exports;var _$bignumber_194={exports:{}};!function(e){"use strict";var t,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,n=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",s=1e14,c=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],u=1e9;function f(e){var t=0|e;return e>0||e===t?t:t-1}function h(e){for(var t,r,i=1,n=e.length,o=e[0]+"";iu^r?1:-1;for(s=(c=n.length)<(u=o.length)?c:u,a=0;ao[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function _(e,t,r,i){if(er||e!==n(e))throw Error(o+(i||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function d(e){var t=e.c.length-1;return f(e.e/14)==t&&e.c[t]%2!=0}function p(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function m(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(i=e.length)){for(n=r,t-=i;--t;n+=r);e+=n}else tx?d.c=d.e=null:e.e=10;u/=10,c++);return void(c>x?d.c=d.e=null:(d.e=c,d.c=[e]))}l=String(e)}else{if(!r.test(l=String(e)))return y(d,l,f);d.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(c=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(c<0&&(c=u),c+=+l.slice(u+1),l=l.substring(0,u)):c<0&&(c=l.length)}else{if(_(t,2,D.length,"Base"),10==t)return q(d=new U(e),M+d.e+1,T);if(l=String(e),f="number"==typeof e){if(0*e!=0)return y(d,l,f,t);if(d.s=1/e<0?(l=l.slice(1),-1):1,U.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else d.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(i=D.slice(0,t),c=u=0,h=l.length;uc){c=h;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,c=0;continue}return y(d,String(e),f,t)}f=!1,(c=(l=g(l,t,10,d.s)).indexOf("."))>-1?l=l.replace(".",""):c=l.length}for(u=0;48===l.charCodeAt(u);u++);for(h=l.length;48===l.charCodeAt(--h););if(l=l.slice(u,++h)){if(h-=u,f&&U.DEBUG&&h>15&&(e>9007199254740991||e!==n(e)))throw Error(a+d.s*e);if((c=c-u-1)>x)d.c=d.e=null;else if(c=I)?p(c,a):m(c,a,"0");else if(o=(e=q(new U(e),t,r)).e,s=(c=h(e.c)).length,1==i||2==i&&(t<=o||o<=R)){for(;ss){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function j(e,t){for(var r,i=1,n=new U(e[0]);i=10;n/=10,i++);return(r=i+14*r-1)>x?e.c=e.e=null:r=10;h/=10,a++);if((u=t-a)<0)u+=14,f=t,d=(l=p[_=0])/m[a-f-1]%10|0;else if((_=i((u+1)/14))>=p.length){if(!o)break e;for(;p.length<=_;p.push(0));l=d=0,a=1,f=(u%=14)-14+1}else{for(l=h=p[_],a=1;h>=10;h/=10,a++);d=(f=(u%=14)-14+a)<0?0:l/m[a-f-1]%10|0}if(o=o||t<0||null!=p[_+1]||(f<0?l:l%m[a-f-1]),o=r<4?(d||o)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||o||6==r&&(u>0?f>0?l/m[a-f]:0:p[_-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,o?(t-=e.e+1,p[0]=m[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==u?(p.length=_,h=1,_--):(p.length=_+1,h=m[14-u],p[_]=f>0?n(l/m[a-f]%m[f])*h:0),o)for(;;){if(0==_){for(u=1,f=p[0];f>=10;f/=10,u++);for(f=p[0]+=h,h=1;f>=10;f/=10,h++);u!=h&&(e.e++,p[0]==s&&(p[0]=1));break}if(p[_]+=h,p[_]!=s)break;p[_--]=0,h=1}for(u=p.length;0===p[--u];p.pop());}e.e>x?e.c=e.e=null:e.e=I?p(t,r):m(t,r,"0"),e.s<0?"-"+t:t)}return U.clone=e,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,u,t),M=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),T=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-u,0,t),_(r[1],0,u,t),R=r[0],I=r[1]):(_(r,-u,u,t),R=-(I=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-u,-1,t),_(r[1],1,u,t),P=r[0],x=r[1];else{if(_(r,-u,u,t),!r)throw Error(o+t+" cannot be zero: "+r);P=-(x=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(o+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw O=!r,Error(o+"crypto unavailable");O=r}else O=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),C=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,u,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(o+t+" not an object: "+r);L=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);D=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:T,EXPONENTIAL_AT:[R,I],RANGE:[P,x],CRYPTO:O,MODULO_MODE:C,POW_PRECISION:N,FORMAT:L,ALPHABET:D}},U.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!U.DEBUG)return!0;var t,r,i=e.c,a=e.e,c=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===c||-1===c)&&a>=-u&&a<=u&&a===n(a)){if(0===i[0]){if(0===a&&1===i.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(i[0]).length==t){for(t=0;t=s||r!==n(r))break e;if(0!==r)return!0}}}else if(null===i&&null===a&&(null===c||1===c||-1===c))return!0;throw Error(o+"Invalid BigNumber: "+e)},U.maximum=U.max=function(){return j(arguments,B.lt)},U.minimum=U.min=function(){return j(arguments,B.gt)},U.random=(v=9007199254740992*Math.random()&2097151?function(){return n(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,a,s,f,h=0,l=[],d=new U(k);if(null==e?e=M:_(e,0,u),s=i(e/14),O)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));h>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[h]=r[0],t[h+1]=r[1]):(l.push(f%1e14),h+=2);h=s/2}else{if(!crypto.randomBytes)throw O=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);h=9e15?crypto.randomBytes(7).copy(t,h):(l.push(f%1e14),h+=7);h=s/7}if(!O)for(;h=10;f/=10,h++);h<14&&(a-=14-h)}return d.e=a,d.c=l,d}),U.sum=function(){for(var e=1,t=arguments,r=new U(t[0]);er-1&&(null==a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}return function(t,r,i,n,o){var a,s,c,u,f,l,_,d,p=t.indexOf("."),g=M,y=T;for(p>=0&&(u=N,N=0,t=t.replace(".",""),l=(d=new U(r)).pow(t.length-p),N=u,d.c=e(m(h(l.c),l.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=u=(_=e(t,r,i,o?(a=D,"0123456789"):(a="0123456789",D))).length;0==_[--u];_.pop());if(!_[0])return a.charAt(0);if(p<0?--c:(l.c=_,l.e=c,l.s=n,_=(l=b(l,d,g,y,i)).c,f=l.r,c=l.e),p=_[s=c+g+1],u=i/2,f=f||s<0||null!=_[s+1],f=y<4?(null!=p||f)&&(0==y||y==(l.s<0?3:2)):p>u||p==u&&(4==y||f||6==y&&1&_[s-1]||y==(l.s<0?8:7)),s<1||!_[0])t=f?m(a.charAt(1),-g,a.charAt(0)):a.charAt(0);else{if(_.length=s,f)for(--i;++_[--s]>i;)_[s]=0,s||(++c,_=[1].concat(_));for(u=_.length;!_[--u];);for(p=0,t="";p<=u;t+=a.charAt(_[p++]));t=m(t,c,a.charAt(0))}return t}}(),b=function(){function e(e,t,r){var i,n,o,a,s=0,c=e.length,u=t%1e7,f=t/1e7|0;for(e=e.slice();c--;)s=((n=u*(o=e[c]%1e7)+(i=f*o+(a=e[c]/1e7|0)*u)%1e7*1e7+s)/r|0)+(i/1e7|0)+f*a,e[c]=n%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,i){var n,o;if(r!=i)o=r>i?1:-1;else for(n=o=0;nt[n]?1:-1;break}return o}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r]1;e.splice(0,1));}return function(i,o,a,c,u){var h,l,_,d,p,m,b,g,y,v,w,$,E,S,A,B,k,M=i.s==o.s?1:-1,T=i.c,R=o.c;if(!(T&&T[0]&&R&&R[0]))return new U(i.s&&o.s&&(T?!R||T[0]!=R[0]:R)?T&&0==T[0]||!R?0*M:M/0:NaN);for(y=(g=new U(M)).c=[],M=a+(l=i.e-o.e)+1,u||(u=s,l=f(i.e/14)-f(o.e/14),M=M/14|0),_=0;R[_]==(T[_]||0);_++);if(R[_]>(T[_]||0)&&l--,M<0)y.push(1),d=!0;else{for(S=T.length,B=R.length,_=0,M+=2,(p=n(u/(R[0]+1)))>1&&(R=e(R,p,u),T=e(T,p,u),B=R.length,S=T.length),E=B,w=(v=T.slice(0,B)).length;w=u/2&&A++;do{if(p=0,(h=t(R,v,B,w))<0){if($=v[0],B!=w&&($=$*u+(v[1]||0)),(p=n($/A))>1)for(p>=u&&(p=u-1),b=(m=e(R,p,u)).length,w=v.length;1==t(m,v,b,w);)p--,r(m,B=10;M/=10,_++);q(g,a+(g.e=_+14*l-1)+1,c,d)}else g.e=l,g.r=+d;return g}}(),w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,E=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g,y=function(e,t,r,i){var n,a=r?t:t.replace(A,"");if(S.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(w,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?e:t})),i&&(n=i,a=a.replace($,"$1").replace(E,"0.$1")),t!=a))return new U(a,n);if(U.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},B.absoluteValue=B.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return l(this,new U(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,i,n,o=this;if(null!=e)return _(e,0,u),null==t?t=T:_(t,0,8),q(new U(o),e+o.e+1,t);if(!(r=o.c))return null;if(i=14*((n=r.length-1)-f(this.e/14)),n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},B.dividedBy=B.div=function(e,t){return b(this,new U(e,t),M,T)},B.dividedToIntegerBy=B.idiv=function(e,t){return b(this,new U(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,a,s,c,u,f,h,l,_=this;if((e=new U(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+K(e));if(null!=t&&(t=new U(t)),u=e.e>14,!_.c||!_.c[0]||1==_.c[0]&&!_.e&&1==_.c.length||!e.c||!e.c[0])return l=new U(Math.pow(+K(_),u?2-d(e):+K(e))),t?l.mod(t):l;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new U(NaN);(a=!f&&_.isInteger()&&t.isInteger())&&(_=_.mod(t))}else{if(e.e>9&&(_.e>0||_.e<-1||(0==_.e?_.c[0]>1||u&&_.c[1]>=24e7:_.c[0]<8e13||u&&_.c[0]<=9999975e7)))return c=_.s<0&&d(e)?-0:0,_.e>-1&&(c=1/c),new U(f?1/c:c);N&&(c=i(N/14+2))}for(u?(r=new U(.5),f&&(e.s=1),h=d(e)):h=(s=Math.abs(+K(e)))%2,l=new U(k);;){if(h){if(!(l=l.times(_)).c)break;c?l.c.length>c&&(l.c.length=c):a&&(l=l.mod(t))}if(s){if(0===(s=n(s/2)))break;h=s%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)h=d(e);else{if(0==(s=+K(e)))break;h=s%2}_=_.times(_),c?_.c&&_.c.length>c&&(_.c.length=c):a&&(_=_.mod(t))}return a?l:(f&&(l=k.div(l)),t?l.mod(t):c?q(l,N,T,void 0):l)},B.integerValue=function(e){var t=new U(this);return null==e?e=T:_(e,0,8),q(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===l(this,new U(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return l(this,new U(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=l(this,new U(e,t)))||0===t},B.isInteger=function(){return!!this.c&&f(this.e/14)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return l(this,new U(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=l(this,new U(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,i,n,o,a=this,c=a.s;if(t=(e=new U(e,t)).s,!c||!t)return new U(NaN);if(c!=t)return e.s=-t,a.plus(e);var u=a.e/14,h=e.e/14,l=a.c,_=e.c;if(!u||!h){if(!l||!_)return l?(e.s=-t,e):new U(_?a:NaN);if(!l[0]||!_[0])return _[0]?(e.s=-t,e):new U(l[0]?a:3==T?-0:0)}if(u=f(u),h=f(h),l=l.slice(),c=u-h){for((o=c<0)?(c=-c,n=l):(h=u,n=_),n.reverse(),t=c;t--;n.push(0));n.reverse()}else for(i=(o=(c=l.length)<(t=_.length))?c:t,c=t=0;t0)for(;t--;l[r++]=0);for(t=s-1;i>c;){if(l[--i]<_[i]){for(r=i;r&&!l[--r];l[r]=t);--l[r],l[i]+=s}l[i]-=_[i]}for(;0==l[0];l.splice(0,1),--h);return l[0]?z(e,l,h):(e.s=3==T?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var r,i,n=this;return e=new U(e,t),!n.c||!e.s||e.c&&!e.c[0]?new U(NaN):!e.c||n.c&&!n.c[0]?new U(n):(9==C?(i=e.s,e.s=1,r=b(n,e,0,3),e.s=i,r.s*=i):r=b(n,e,0,C),(e=n.minus(r.times(e))).c[0]||1!=C||(e.s=n.s),e)},B.multipliedBy=B.times=function(e,t){var r,i,n,o,a,c,u,h,l,_,d,p,m,b,g=this,y=g.c,v=(e=new U(e,t)).c;if(!(y&&v&&y[0]&&v[0]))return!g.s||!e.s||y&&!y[0]&&!v||v&&!v[0]&&!y?e.c=e.e=e.s=null:(e.s*=g.s,y&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(i=f(g.e/14)+f(e.e/14),e.s*=g.s,(u=y.length)<(_=v.length)&&(m=y,y=v,v=m,n=u,u=_,_=n),n=u+_,m=[];n--;m.push(0));for(b=s,1e7,n=_;--n>=0;){for(r=0,d=v[n]%1e7,p=v[n]/1e7|0,o=n+(a=u);o>n;)r=((h=d*(h=y[--a]%1e7)+(c=p*h+(l=y[a]/1e7|0)*d)%1e7*1e7+m[o]+r)/b|0)+(c/1e7|0)+p*l,m[o--]=h%b;m[o]=r}return r?++i:m.splice(0,1),z(e,m,i)},B.negated=function(){var e=new U(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,i=this,n=i.s;if(t=(e=new U(e,t)).s,!n||!t)return new U(NaN);if(n!=t)return e.s=-t,i.minus(e);var o=i.e/14,a=e.e/14,c=i.c,u=e.c;if(!o||!a){if(!c||!u)return new U(n/0);if(!c[0]||!u[0])return u[0]?e:new U(c[0]?i:0*n)}if(o=f(o),a=f(a),c=c.slice(),n=o-a){for(n>0?(a=o,r=u):(n=-n,r=c),r.reverse();n--;r.push(0));r.reverse()}for((n=c.length)-(t=u.length)<0&&(r=u,u=c,c=r,t=n),n=0;t;)n=(c[--t]=c[t]+u[t]+n)/s|0,c[t]=s===c[t]?0:c[t]%s;return n&&(c=[n].concat(c),++a),z(e,c,a)},B.precision=B.sd=function(e,t){var r,i,n,o=this;if(null!=e&&e!==!!e)return _(e,1,u),null==t?t=T:_(t,0,8),q(new U(o),e,t);if(!(r=o.c))return null;if(i=14*(n=r.length-1)+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&o.e+1>i&&(i=o.e+1),i},B.shiftedBy=function(e){return _(e,-9007199254740991,9007199254740991),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,r,i,n,o=this,a=o.c,s=o.s,c=o.e,u=M+4,l=new U("0.5");if(1!==s||!a||!a[0])return new U(!s||s<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(s=Math.sqrt(+K(o)))||s==1/0?(((t=h(a)).length+c)%2==0&&(t+="0"),s=Math.sqrt(+t),c=f((c+1)/2)-(c<0||c%2),r=new U(t=s==1/0?"5e"+c:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new U(s+""),r.c[0])for((s=(c=r.e)+u)<3&&(s=0);;)if(n=r,r=l.times(n.plus(b(o,n,u,1))),h(n.c).slice(0,s)===(t=h(r.c)).slice(0,s)){if(r.e0&&p>0){for(a=p%c||c,h=d.substr(0,a);a0&&(h+=f+d.slice(a)),_&&(h="-"+h)}i=l?h+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+i+(r.suffix||"")},B.toFraction=function(e){var t,r,i,n,a,s,u,f,l,_,d,p,m=this,g=m.c;if(null!=e&&(!(u=new U(e)).isInteger()&&(u.c||1!==u.s)||u.lt(k)))throw Error(o+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+K(u));if(!g)return new U(m);for(t=new U(k),l=r=new U(k),i=f=new U(k),p=h(g),a=t.e=p.length-m.e-1,t.c[0]=c[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=x,x=1/0,u=new U(p),f.c[0]=0;_=b(u,t,0,1),1!=(n=r.plus(_.times(i))).comparedTo(e);)r=i,i=n,l=f.plus(_.times(n=l)),f=n,t=u.minus(_.times(n=t)),u=n;return n=b(e.minus(r),i,0,1),f=f.plus(n.times(l)),r=r.plus(n.times(i)),f.s=l.s=m.s,d=b(l,i,a*=2,T).minus(m).abs().comparedTo(b(f,r,a,T).minus(m).abs())<1?[l,i]:[f,r],x=s,d},B.toNumber=function(){return+K(this)},B.toPrecision=function(e,t){return null!=e&&_(e,1,u),H(this,e,t,2)},B.toString=function(e){var t,r=this,i=r.s,n=r.e;return null===n?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=n<=R||n>=I?p(h(r.c),n):m(h(r.c),n,"0"):10===e?t=m(h((r=q(new U(r),M+n+1,T)).c),r.e,"0"):(_(e,2,D.length,"Base"),t=g(m(h(r.c),n,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return K(this)},B._isBigNumber=!0,null!=t&&U.set(t),U}()).default=t.BigNumber=t,"function"==typeof define&&define.amd?define((function(){return t})):_$bignumber_194.exports?_$bignumber_194.exports=t:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=t)}(this),_$bignumber_194=_$bignumber_194.exports;var _$util_449={};(function(e){(function(){"use strict";Object.defineProperty(_$util_449,"__esModule",{value:!0}),_$util_449.pushdata=t=>{if(0===t.length)return e.from(Uint8Array.from([76,0]));if(t.length<78)return e.concat([Uint8Array.from([t.length]),t]);if(t.length<255)return e.concat([Uint8Array.from([76,t.length]),t]);if(t.length<65535){const r=e.allocUnsafe(2);return r.writeUInt16LE(t.length,0),e.concat([Uint8Array.from([77]),r,t])}if(t.length<4294967295){const r=e.allocUnsafe(4);return r.writeUInt32LE(t.length,0),e.concat([Uint8Array.from([78]),r,t])}throw new Error("does not support bigger pushes yet")},_$util_449.BNToInt64BE=t=>{if(!t.isInteger())throw new Error("bn not an integer");if(!t.isPositive())throw new Error("bn not positive integer");const r=t.toString(16);if(r.length>16)throw new Error("bn outside of range");return e.from(r.padStart(16,"0"),"hex")},_$util_449.createOpReturnGenesis=(t,r,i,n,o,a,s,c)=>{if(![1,65,129].includes(t))throw new Error("unknown versionType");if("string"==typeof o){if(0!==o.length&&64!==o.length)throw new Error("documentHash must be either 0 or 32 hex bytes");if(64===o.length&&!o.match(/^[0-9a-fA-F]{64}$/))throw new Error("documentHash must be hex");o=e.from(o,"hex")}else if(0!==o.length&&32!==o.length)throw new Error("documentHash must be either 0 or 32 hex bytes");if(a<0||a>9)throw new Error("decimals out of range");if(null!==s&&(s<2||s>255))throw new Error("mintBatonVout out of range (0x02 < > 0xFF)");if(65===t){if(!c.isEqualTo(1))throw new Error("quantity must be 1 for NFT1 child genesis");if(0!==a)throw new Error("decimals must be 0 for NFT1 child genesis");if(null!==s)throw new Error("mintBatonVout must be null for NFT1 child genesis")}return e.concat([Uint8Array.from([106]),_$util_449.pushdata(e.from("SLP\0")),_$util_449.pushdata(Uint8Array.from([t])),_$util_449.pushdata(e.from("GENESIS")),_$util_449.pushdata(e.from(r)),_$util_449.pushdata(e.from(i)),_$util_449.pushdata(e.from(n)),_$util_449.pushdata(o),_$util_449.pushdata(Uint8Array.from([a])),_$util_449.pushdata(Uint8Array.from(null===s?[]:[s])),_$util_449.pushdata(_$util_449.BNToInt64BE(c))])},_$util_449.createOpReturnMint=(t,r,i,n)=>{if(![1,65,129].includes(t))throw new Error("unknown versionType");if("string"==typeof r){if(!r.match(/^[0-9a-fA-F]{64}$/))throw new Error("tokenIdHex does not pass regex");if(64!==r.length)throw new Error("tokenIdHex must be 32 bytes");r=e.from(r,"hex")}else if(32!==r.length)throw new Error("tokenIdHex must be 32 bytes");if(null!==i&&(i<2||i>255))throw new Error("mintBatonVout out of range (0x02 < > 0xFF)");return e.concat([Uint8Array.from([106]),_$util_449.pushdata(e.from("SLP\0")),_$util_449.pushdata(Uint8Array.from([t])),_$util_449.pushdata(e.from("MINT")),_$util_449.pushdata(r),_$util_449.pushdata(Uint8Array.from(null===i?[]:[i])),_$util_449.pushdata(_$util_449.BNToInt64BE(n))])},_$util_449.createOpReturnSend=(t,r,i)=>{if(![1,65,129].includes(t))throw new Error("unknown versionType");if("string"==typeof r){if(!r.match(/^[0-9a-fA-F]{64}$/))throw new Error("tokenIdHex does not pass regex");if(64!==r.length)throw new Error("tokenIdHex must be 32 bytes");r=e.from(r,"hex")}else if(32!==r.length)throw new Error("tokenIdHex must be 32 bytes");if(i.length<1)throw new Error("send requires at least one amount");if(i.length>19)throw new Error("too many slp amounts");return e.concat([Uint8Array.from([106]),_$util_449.pushdata(e.from("SLP\0")),_$util_449.pushdata(Uint8Array.from([t])),_$util_449.pushdata(e.from("SEND")),_$util_449.pushdata(r),...i.map(e=>_$util_449.pushdata(_$util_449.BNToInt64BE(e)))])}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$tokentype1_448={};Object.defineProperty(_$tokentype1_448,"__esModule",{value:!0}),_$tokentype1_448.default={genesis:(e,t,r,i,n,o,a)=>_$util_449.createOpReturnGenesis(1,e,t,r,i,n,o,a),mint:(e,t,r)=>_$util_449.createOpReturnMint(1,e,t,r),send:(e,t)=>_$util_449.createOpReturnSend(1,e,t)};var _$nft1_447={},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$nft1_447,"__esModule",{value:!0});const bignumber_js_1=__importDefault(_$bignumber_194);_$nft1_447.default={Group:{genesis:(e,t,r,i,n,o,a)=>_$util_449.createOpReturnGenesis(129,e,t,r,i,n,o,a),mint:(e,t,r)=>_$util_449.createOpReturnMint(129,e,t,r),send:(e,t)=>_$util_449.createOpReturnSend(129,e,t)},Child:{genesis:(e,t,r,i)=>_$util_449.createOpReturnGenesis(65,e,t,r,i,0,null,new bignumber_js_1.default(1)),send:(e,t)=>_$util_449.createOpReturnSend(65,e,t)}};var _$dist_446={},____importDefault_446=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$dist_446,"__esModule",{value:!0});const __bignumber_js_1_446=____importDefault_446(_$bignumber_194);_$dist_446.BN=__bignumber_js_1_446.default;const tokentype1_1=____importDefault_446(_$tokentype1_448);_$dist_446.TokenType1=tokentype1_1.default;const nft1_1=____importDefault_446(_$nft1_447);let addy,_this;_$dist_446.NFT1=nft1_1.default;var _$tokentype1_38=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},addy=new _$address_34(e),this.Script=new _$script_33,this.axios=_$axios_119,_$TransactionBuilder_40.setAddress(addy),_this=this}generateSendOpReturn(e,t){try{const r=e[0].tokenId,i=e[0].decimals,n=new _$bignumber_11(t).times(10**i),o=e.reduce((e,t)=>e.plus(new _$bignumber_11(t.tokenQty).times(10**i)),new _$bignumber_11(0)),a=o.minus(n);let s,c=1;if(a>0){c=2;const e=n.toString(),t=a.toString(),i=new _$bignumber_11(t).plus(new _$bignumber_11(e)),u=new _$bignumber_11(o);if("0"!==i.minus(u).toString())throw new Error("Token transaction inputs do not match outputs, cannot send transaction");s=_$dist_446.TokenType1.send(r,[new _$dist_446.BN(e),new _$dist_446.BN(t)])}else{const e=n.toString(),t=new _$bignumber_11(e),i=new _$bignumber_11(o);if("0"!==t.minus(i).toString())throw new Error("Token transaction inputs do not match outputs, cannot send transaction");s=_$dist_446.TokenType1.send(r,[new _$dist_446.BN(e)])}return{script:s,outputs:c}}catch(err){throw console.log("Error in generateSendOpReturn()"),err}}generateBurnOpReturn(e,t){try{const r=e[0].tokenId,i=e[0].decimals;let n=0;for(let t=0;tn&&(t=n);let o=new _$bignumber_11(n-t).times(10**i);return o=o.absoluteValue(),o=(o=Math.floor(o)).toString(),_$dist_446.TokenType1.send(r,[new _$dist_446.BN(o)])}catch(err){throw console.log("Error in generateBurnOpReturn()"),err}}generateGenesisOpReturn(e){try{let t;return t=(t=0!==e.decimals?new _$bignumber_11(e.initialQty).times(10**e.decimals):new _$bignumber_11(e.initialQty)).absoluteValue(),t=(t=Math.floor(t)).toString(),e.documentHash||(e.documentHash=""),e.mintBatonVout||(e.mintBatonVout=null),_$dist_446.TokenType1.genesis(e.ticker,e.name,e.documentUrl,e.documentHash,e.decimals,e.mintBatonVout,new _$dist_446.BN(t))}catch(err){throw console.log("Error in generateGenesisOpReturn()"),err}}generateMintOpReturn(e,t,r=!1){try{if(!Array.isArray(e))throw new Error("tokenUtxos must be an array.");if(!t)throw new Error("mintQty must be a positive number.");let i;for(let t=0;t0){a=2;const e=Math.floor(t).toString(),i=Math.floor(n).toString();o=_$dist_446.NFT1.Child.send(r,[new _$dist_446.BN(e),new _$dist_446.BN(i)])}else{const e=Math.floor(t).toString();o=_$dist_446.NFT1.Child.send(r,[new _$dist_446.BN(e)])}return{script:o,outputs:a}}catch(err){throw console.log("Error in generateNFTChildSendOpReturn()"),err}}generateNFTGroupSendOpReturn(e,t){try{const r=e[0].tokenId;let i=0;for(let t=0;t0){a=2;const e=Math.floor(t).toString(),i=Math.floor(n).toString();o=_$dist_446.NFT1.Group.send(r,[new _$dist_446.BN(e),new _$dist_446.BN(i)])}else{const e=Math.floor(t).toString();o=_$dist_446.NFT1.Group.send(r,[new _$dist_446.BN(e)])}return{script:o,outputs:a}}catch(err){throw console.log("Error in generateNFTGroupSendOpReturn()"),err}}async listNFTGroupChildren(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}slp/nftChildren/${e}`,this.axiosOptions)).data;throw new Error("groupId must be a string.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async parentNFTGroup(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}slp/nftGroup/${e}`,this.axiosOptions)).data;throw new Error("tokenId must be a string.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}},_$dist_450={};(function(e){(function(){"use strict";var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$dist_450,"__esModule",{value:!0});const r=t(_$bignumber_194);_$dist_450.BN=r.default,_$dist_450.parseSLP=t=>{"string"==typeof t&&(t=e.from(t,"hex"));let i=0,n=t;const o=(e,t)=>{if(e)throw Error(t)},a=()=>{const e=n.readUInt8(i);return i+=1,new r.default(e)},s=()=>{const e=n.readUInt16LE(i);return i+=2,new r.default(e)},c=()=>{const e=n.readUInt32LE(i);return i+=4,new r.default(e)};o(0===n.length,"scriptpubkey cannot be empty"),o(106!==n[i],"scriptpubkey not op_return"),o(n.length<10,"scriptpubkey too small"),++i;const u=()=>{if(i===n.length)return-1;const e=a().toNumber();return e>0&&e<76?i+e>n.length?(--i,-1):e:76===e?i+1>=n.length?(--i,-1):a().toNumber():77===e?i+2>=n.length?(--i,-1):s().toNumber():78===e?i+4>=n.length?(--i,-1):c().toNumber():(--i,-1)},f=()=>{if(1===n.length)return a();if(2===n.length)return s();if(4===n.length)return c();if(8===n.length)return(()=>{const e=n.readUInt32LE(i);i+=4;const t=n.readUInt32LE(i);return i+=4,new r.default(t).multipliedBy(Math.pow(2,32)).plus(e)})();throw new Error("extraction of number from buffer failed")},h=e=>32===e.length,l=[];for(let e=u();e>=0;e=u()){const t=n.slice(i,i+e);if(o(i+e>n.length,"pushdata data extraction failed"),i+=e,l.push(t),1===l.length){const e=l[0];o(4!==e.length,"lokad id wrong size"),o(e[0]!=="S".charCodeAt(0)||e[1]!=="L".charCodeAt(0)||e[2]!=="P".charCodeAt(0)||0!==e[3],"SLP not in first chunk")}}o(i!==n.length,"trailing data"),o(0===l.length,"chunks empty");let _=0;const d=()=>{o(++_===l.length,"parsing ended early"),i=0,n=l[_]};d();const p=n.reverse();o(1!==p.length&&2!==p.length,"token_type string length must be 1 or 2");const m=f().toNumber();o(![1,65,129].includes(m),"token_type not token-type1, nft1-group, or nft1-child"),d();const b=n.toString();if("GENESIS"===b){o(10!==l.length,"wrong number of chunks"),d();const e=n;d();const t=n;d();const r=n;d();const i=n;o(!(0===i.length||32===i.length),"document_hash must be size 0 or 32"),d(),o(1!==n.length,"decimals string length must be 1");const a=f().toNumber();o(a>9,"decimals bigger than 9"),d();const s=n;let c=0;o(s.length>=2,"mint_baton_vout string length must be 0 or 1"),s.length>0&&(c=f().toNumber(),o(c<2,"mint_baton_vout must be at least 2")),d();const u=n.reverse();o(8!==u.length,"initial_qty must be provided as an 8-byte buffer");const h=f();return 65===m&&(o(0!==a,"NFT1 child token must have divisibility set to 0 decimal places"),o(0!==c,"NFT1 child token must not have a minting baton"),o(!h.isEqualTo(1),"NFT1 child token must have quantity of 1")),{tokenType:m,transactionType:b,data:{ticker:e,name:t,documentUri:r,documentHash:i,decimals:a,mintBatonVout:c,qty:h}}}if("MINT"===b){o(65===m,"NFT1 Child cannot have MINT transaction type."),o(6!==l.length,"wrong number of chunks"),d();const e=n;o(!h(e),"tokenId invalid size"),d();const t=n;let r=0;o(t.length>=2,"mint_baton_vout string length must be 0 or 1"),t.length>0&&(r=f().toNumber(),o(r<2,"mint_baton_vout must be at least 2")),d();const i=n.reverse();return o(8!==i.length,"additional_qty must be provided as an 8-byte buffer"),{tokenType:m,transactionType:b,data:{tokenId:e,mintBatonVout:r,qty:f()}}}if("SEND"===b){o(l.length<4,"wrong number of chunks"),d();const e=n;o(!h(e),"tokenId invalid size"),d();const t=[];for(;_!==l.length;){const e=n.reverse();o(8!==e.length,"amount string size not 8 bytes");const r=f();t.push(r),n=l[++_],i=0}return o(0===t.length,"token_amounts size is 0"),o(t.length>19,"token_amounts size is greater than 19"),{tokenType:m,transactionType:b,data:{tokenId:e,amounts:t}}}return o(!0,"unknown action type"),{tokenType:m,transactionType:b,data:{}}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$utils_39={};(function(e){(function(){let t;_$utils_39=class{constructor(e={}){this.restURL=e.restURL,this.apiToken=e.apiToken,this.slpParser=_$dist_450,this.authToken=e.authToken,this.axios=_$axios_119,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},t=this,this.whitelist=[],this.util=new _$util_42(e)}async decodeOpReturn(r,i=null,n=null){if(i){if(!(i instanceof Object))throw new Error("decodeOpReturn cache parameter must be Object");const e=i[r];if(e)return e}try{if(!r||""===r||"string"!=typeof r)throw new Error("txid string must be included.");const o=this.restURL+"rawtransactions/getRawTransaction",a=(await this.axios.post(o,{verbose:!0,txids:[r],usrObj:n},this.axiosOptions)).data[0].vout[0].scriptPubKey.hex,s=t.slpParser.parseSLP(e.from(a,"hex"));let c={};return"SEND"===s.transactionType?c={tokenType:s.tokenType,txType:s.transactionType,tokenId:s.data.tokenId.toString("hex"),amounts:s.data.amounts}:"GENESIS"===s.transactionType?c={tokenType:s.tokenType,txType:s.transactionType,ticker:s.data.ticker.toString(),name:s.data.name.toString(),tokenId:r,documentUri:s.data.documentUri.toString(),documentHash:s.data.documentHash.toString(),decimals:s.data.decimals,mintBatonVout:s.data.mintBatonVout,qty:s.data.qty}:"MINT"===s.transactionType&&(c={tokenType:s.tokenType,txType:s.transactionType,tokenId:s.data.tokenId.toString("hex"),mintBatonVout:s.data.mintBatonVout,qty:s.data.qty}),i&&(i[r]=c),c}catch(o){throw o}}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$slp_37=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},this.Address=new _$address_34(e),this.ECPair=_$ecpair_35,this.TokenType1=new _$tokentype1_38(e),this.NFT1=new _$nft1_36(e),this.Utils=new _$utils_39(e)}};let ___this_24;var _$encryption_24=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.axios=_$axios_119,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},___this_24=this}async getPubKey(e){try{if(!e||"string"!=typeof e)throw new Error("Input must be a valid Bitcoin Cash address.");return(await ___this_24.axios.get(`${this.restURL}encryption/publickey/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}},_$electrumx_23=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},this.blockchain=new _$blockchain_17(e)}async utxo(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}electrumx/utxos/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"electrumx/utxos",{addresses:e},this.axiosOptions)).data;throw new Error("Input address must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async balance(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}electrumx/balance/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"electrumx/balance",{addresses:e},this.axiosOptions)).data;throw new Error("Input address must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async transactions(e,t=null){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}electrumx/transactions/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"electrumx/transactions",{addresses:e,usrObj:t},this.axiosOptions)).data;throw new Error("Input address must be a string or array of strings.")}catch(r){throw r.response&&r.response.data?r.response.data:r}}async unconfirmed(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}electrumx/unconfirmed/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"electrumx/unconfirmed",{addresses:e},this.axiosOptions)).data;throw new Error("Input address must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async blockHeader(e,t=1){try{return(await _$axios_119.get(`${this.restURL}electrumx/block/headers/${e}?count=${t}`,this.axiosOptions)).data}catch(r){throw r.response&&r.response.data?r.response&&r.response.data?new Error(r.response.data.error):r.response.data:r}}async txData(e){try{if("string"==typeof e)return(await _$axios_119.get(`${this.restURL}electrumx/tx/data/${e}`,this.axiosOptions)).data;if(Array.isArray(e))return(await _$axios_119.post(this.restURL+"electrumx/tx/data",{txids:e},this.axiosOptions)).data;throw new Error("Input txId must be a string or array of strings.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async broadcast(e){try{if("string"==typeof e)return(await _$axios_119.post(this.restURL+"electrumx/tx/broadcast",{txHex:e},this.axiosOptions)).data;throw new Error("Input txHex must be a string.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}sortConfTxs(e,t="DESCENDING"){try{return e=e.filter(e=>e.height>0),"DESCENDING"===t?e.sort((e,t)=>t.height-e.height):e.sort((e,t)=>e.height-t.height)}catch(err){throw console.log("Error in util.js/sortConfTxs()"),err}}async sortAllTxs(e,t="DESCENDING"){try{const r=await this.blockchain.getBlockCount()+1,i=e.map(e=>(e.height<=0&&(e.height=r),e));return this.sortConfTxs(i,t)}catch(err){throw console.log("Error in util.js/sort0ConfTxs"),err}}},_$psfSlpIndexer_30=class{constructor(e={}){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},this.rawTransaction=new _$rawTransactions_31(e),this.slpUtils=new _$utils_39(e)}async status(){try{return(await _$axios_119.get(this.restURL+"psf/slp/status",this.axiosOptions)).data}catch(e){throw e.response&&e.response.data?e.response.data:e}}async balance(e){try{if("string"==typeof e)return(await _$axios_119.post(this.restURL+"psf/slp/address",{address:e},this.axiosOptions)).data;throw new Error("Input address must be a string.")}catch(t){throw t.response&&t.response.data?t.response.data:t}}async tokenStats(e,t=!1){try{if("string"==typeof e)return(await _$axios_119.post(this.restURL+"psf/slp/token",{tokenId:e,withTxHistory:t},this.axiosOptions)).data;throw new Error("Input tokenId must be a string.")}catch(r){throw r.response&&r.response.data?r.response.data:r}}async tx(e){try{if("string"==typeof e)return(await _$axios_119.post(this.restURL+"psf/slp/txid",{txid:e},this.axiosOptions)).data;throw new Error("Input txid must be a string.")}catch(t){if(t.response&&t.response.data&&t.response.data.error&&t.response.data.error.includes("Key not found in database")){const t=await this.checkBlacklist(e),r=await this.rawTransaction.getTxData(e);return r.isValidSlp=!!t&&null,{txData:r}}throw t}}async checkBlacklist(e){try{const t=["dd21be4532d93661e8ffe16db6535af0fb8ee1344d1fef81a193e2b4cfa9fbc9"],r=await this.slpUtils.decodeOpReturn(e);for(let e=0;e!0===e.isSlp&&"token"===e.type&&1===e.tokenType);n=await this.hydrateTokenData(n);const o=r.filter(e=>!1===e.isSlp);let a=r.filter(e=>!0===e.isSlp&&"baton"===e.type&&1===e.tokenType);a=await this.hydrateTokenData(a);let s=r.filter(e=>!0===e.isSlp&&"token"===e.type&&129===e.tokenType);s=await this.hydrateTokenData(s);let c=r.filter(e=>!0===e.isSlp&&"baton"===e.type&&129===e.tokenType);c=await this.hydrateTokenData(c);let u=r.filter(e=>!0===e.isSlp&&"token"===e.type&&65===e.tokenType);return{address:t,bchUtxos:o,slpUtxos:{type1:{tokens:n,mintBatons:a},group:{tokens:s,mintBatons:c},nft:{tokens:u=await this.hydrateTokenData(u)}},nullUtxos:r.filter(e=>null===e.isSlp)}}catch(err){if(console.error("Error in bchjs.Utxo.get(): ",err),err.error)throw new Error(err.error);throw err}}async hydrateTokenData(e){try{let t=e.map(e=>e.tokenId);t=[...new Set(t)];const r=[];for(let e=0;ee.tokenData.tokenId===t.tokenId);if(t.ticker=n[0].tokenData.ticker,t.name=n[0].tokenData.name,t.documentUri=n[0].tokenData.documentUri,t.documentHash=n[0].tokenData.documentHash,t.decimals=n[0].tokenData.decimals,"baton"!==t.type){const e=new _$bignumber_11(t.qty).dividedBy(10**parseInt(t.decimals));t.qtyStr=e.toString(),t.tokenQty=t.qtyStr}}return e}catch(err){throw console.log("Error in hydrateTokenData()"),err}}findBiggestUtxo(e){let t=0,r=0;if(!Array.isArray(e))throw new Error("utxos input to findBiggestUtxo() must be an array");for(let i=0;it&&(t=n.satoshis,r=i)}return e[r]}async isValid(e){try{const t=e.txid||e.tx_hash,r=e.vout|e.tx_pos,i=await this.blockchain.getTxOut(t,r,!0);let n=null;return n=null!==i}catch(err){throw console.log("Error in Utxo.isValid()"),err}}},_$transaction_41=class{constructor(e={}){this.slpUtils=new _$utils_39(e),this.rawTransaction=new _$rawTransactions_31(e),this.blockchain=new _$blockchain_17(e),this.psfSlpIndexer=new _$psfSlpIndexer_30(e)}async get(e){return await this.psfSlpIndexer.tx(e)}async getTokenInfo(e){try{return await this.slpUtils.decodeOpReturn(e)}catch(err){return!1}}};let ___this_20;var _$dsproof_20=class{constructor(e){this.restURL=e.restURL,this.apiToken=e.apiToken,this.authToken=e.authToken,this.axios=_$axios_119,this.authToken?this.axiosOptions={headers:{authorization:this.authToken}}:this.axiosOptions={headers:{authorization:"Token "+this.apiToken}},___this_20=this}async getDSProof(e){try{if(!e)throw new Error("txid is required");if(64!==e.length)throw new Error(`txid must be of length 64 (not ${e.length})`);return(await ___this_20.axios.get(`${this.restURL}dsproof/getdsproof/${e}`,this.axiosOptions)).data}catch(t){throw t.response&&t.response.data?t.response.data:t}}},_$ecash_21=class{toSatoshi(e){if("number"!=typeof e)throw new Error("input must be a floating number representing XEC");return Math.floor(100*e)}toXec(e){if("number"!=typeof e)throw new Error("input must be a floating number representing satoshis");return e/100}},_$bchJs_15={};(function(e,t){(function(){_$bchJs_15=class{constructor(r){if(r&&r.restURL&&""!==r.restURL?this.restURL=r.restURL:e.env.RESTURL&&""!==e.env.RESTURL?this.restURL=e.env.RESTURL:this.restURL="https://api.fullstack.cash/v5/",this.apiToken="",r&&r.apiToken&&""!==r.apiToken?this.apiToken=r.apiToken:this.apiToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxY2YxZTc2OGFlZjk0MDAxMjUwZTZkYiIsImVtYWlsIjoiY2hyaXMudHJvdXRuZXJAZ21haWwuY29tIiwiYXBpTGV2ZWwiOjUwLCJyYXRlTGltaXQiOjMsInBvaW50c1RvQ29uc3VtZSI6NDAsImR1cmF0aW9uIjozMCwiaWF0IjoxNjU1NzUyNDg4LCJleHAiOjE2NTgzNDQ0ODh9.a0QEzxQKAVgZ6XsY1LUgVtWMZo7ax6NmXPRNHJ0aaDc",this.authPass="",r&&r.authPass&&""!==r.authPass?this.authPass=r.authPass:e.env.BCHJSAUTHPASS&&""!==e.env.BCHJSAUTHPASS&&(this.authPass=e.env.BCHJSAUTHPASS),this.authToken="",this.authPass){const e="fullstackcash:"+this.authPass,r=t.from(e).toString("base64");this.authToken="Basic "+r}const i={restURL:this.restURL,apiToken:this.apiToken,authToken:this.authToken};this.Electrumx=new _$electrumx_23(i),this.Control=new _$control_18(i),this.Mining=new _$mining_27(i),this.RawTransactions=new _$rawTransactions_31(i),this.Address=new _$address_14(i),this.BitcoinCash=new _$bitcoincash_16(this.Address),this.Blockchain=new _$blockchain_17(i),this.Crypto=_$crypto_19,this.ECPair=_$ECPair_22,this.ECPair.setAddress(this.Address),this.encryption=new _$encryption_24(i),this.Generating=new _$generating_25(i),this.HDNode=new _$hdnode_26(this.Address),this.Mnemonic=new _$mnemonic_28(this.Address),this.Price=new _$price_29(i),this.Script=new _$script_33,this.TransactionBuilder=_$TransactionBuilder_40,this.TransactionBuilder.setAddress(this.Address),this.Util=new _$util_42(i),this.Schnorr=new _$schnorr_32(i),this.SLP=new _$slp_37(i),this.SLP.HDNode=this.HDNode,this.Utxo=new _$utxo_43(i),this.Transaction=new _$transaction_41(i),this.DSProof=new _$dsproof_20(i),this.eCash=new _$ecash_21,this.PsfSlpIndexer=new _$psfSlpIndexer_30(i)}}}).call(this)}).call(this,_$browser_408,_$buffer_267({}).Buffer);var _$core_283={};(function(t){(function(){var r;r=function(){var r=r||function(r,i){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==t&&t.crypto&&(n=t.crypto),!n)try{n=_$cryptoBrowserify_280({})}catch(err){}var o=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(err){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(err){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},c=s.lib={},u=c.Base={extend:function(e){var t=a(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)}},f=c.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=r.ceil(t/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new f.init(r,t/2)}},_=h.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new f.init(r,t)}},d=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(_.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return _.parse(unescape(encodeURIComponent(e)))}},p=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,i=this._data,n=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?r.ceil(s):r.max((0|s)-this._minBufferSize,0))*a,u=r.min(4*c,o);if(c){for(var h=0;h>>2]|=e[n]<<24-n%4*8;r.call(this,i,t)}else r.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray},"object"==typeof _$libTypedarrays_290?_$libTypedarrays_290=_$libTypedarrays_290=__factory_290(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_290):__factory_290(__root_290.CryptoJS);var _$encUtf16_285={},__root_285,__factory_285;__root_285=this,__factory_285=function(e){return function(){var t=e,r=t.lib.WordArray,i=t.enc;function n(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return r.create(i,2*t)}},i.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(e){for(var t=e.length,i=[],o=0;o>>1]|=n(e.charCodeAt(o)<<16-o%2*16);return r.create(i,2*t)}}}(),e.enc.Utf16},"object"==typeof _$encUtf16_285?_$encUtf16_285=_$encUtf16_285=__factory_285(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_285):__factory_285(__root_285.CryptoJS);var _$encBase64_284={},__root_284,__factory_284;__root_284=this,__factory_284=function(e){return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp();for(var n=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,i=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=s<<24-o%4*8,o++}return r.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64;var t,r},"object"==typeof _$encBase64_284?_$encBase64_284=_$encBase64_284=__factory_284(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_284):__factory_284(__root_284.CryptoJS);var _$md5_291={},__root_291,__factory_291;__root_291=this,__factory_291=function(e){return function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,a=r.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],_=e[t+2],d=e[t+3],p=e[t+4],m=e[t+5],b=e[t+6],g=e[t+7],y=e[t+8],v=e[t+9],w=e[t+10],$=e[t+11],E=e[t+12],S=e[t+13],A=e[t+14],B=e[t+15],k=o[0],M=o[1],T=o[2],R=o[3];k=u(k,M,T,R,a,7,s[0]),R=u(R,k,M,T,c,12,s[1]),T=u(T,R,k,M,_,17,s[2]),M=u(M,T,R,k,d,22,s[3]),k=u(k,M,T,R,p,7,s[4]),R=u(R,k,M,T,m,12,s[5]),T=u(T,R,k,M,b,17,s[6]),M=u(M,T,R,k,g,22,s[7]),k=u(k,M,T,R,y,7,s[8]),R=u(R,k,M,T,v,12,s[9]),T=u(T,R,k,M,w,17,s[10]),M=u(M,T,R,k,$,22,s[11]),k=u(k,M,T,R,E,7,s[12]),R=u(R,k,M,T,S,12,s[13]),T=u(T,R,k,M,A,17,s[14]),k=f(k,M=u(M,T,R,k,B,22,s[15]),T,R,c,5,s[16]),R=f(R,k,M,T,b,9,s[17]),T=f(T,R,k,M,$,14,s[18]),M=f(M,T,R,k,a,20,s[19]),k=f(k,M,T,R,m,5,s[20]),R=f(R,k,M,T,w,9,s[21]),T=f(T,R,k,M,B,14,s[22]),M=f(M,T,R,k,p,20,s[23]),k=f(k,M,T,R,v,5,s[24]),R=f(R,k,M,T,A,9,s[25]),T=f(T,R,k,M,d,14,s[26]),M=f(M,T,R,k,y,20,s[27]),k=f(k,M,T,R,S,5,s[28]),R=f(R,k,M,T,_,9,s[29]),T=f(T,R,k,M,g,14,s[30]),k=h(k,M=f(M,T,R,k,E,20,s[31]),T,R,m,4,s[32]),R=h(R,k,M,T,y,11,s[33]),T=h(T,R,k,M,$,16,s[34]),M=h(M,T,R,k,A,23,s[35]),k=h(k,M,T,R,c,4,s[36]),R=h(R,k,M,T,p,11,s[37]),T=h(T,R,k,M,g,16,s[38]),M=h(M,T,R,k,w,23,s[39]),k=h(k,M,T,R,S,4,s[40]),R=h(R,k,M,T,a,11,s[41]),T=h(T,R,k,M,d,16,s[42]),M=h(M,T,R,k,b,23,s[43]),k=h(k,M,T,R,v,4,s[44]),R=h(R,k,M,T,E,11,s[45]),T=h(T,R,k,M,B,16,s[46]),k=l(k,M=h(M,T,R,k,_,23,s[47]),T,R,a,6,s[48]),R=l(R,k,M,T,g,10,s[49]),T=l(T,R,k,M,A,15,s[50]),M=l(M,T,R,k,m,21,s[51]),k=l(k,M,T,R,E,6,s[52]),R=l(R,k,M,T,d,10,s[53]),T=l(T,R,k,M,w,15,s[54]),M=l(M,T,R,k,c,21,s[55]),k=l(k,M,T,R,y,6,s[56]),R=l(R,k,M,T,B,10,s[57]),T=l(T,R,k,M,b,15,s[58]),M=l(M,T,R,k,S,21,s[59]),k=l(k,M,T,R,p,6,s[60]),R=l(R,k,M,T,$,10,s[61]),T=l(T,R,k,M,_,15,s[62]),M=l(M,T,R,k,v,21,s[63]),o[0]=o[0]+k|0,o[1]=o[1]+M|0,o[2]=o[2]+T|0,o[3]=o[3]+R|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),a=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,i,n,o,a){var s=e+(t&r|~t&i)+n+a;return(s<>>32-o)+t}function f(e,t,r,i,n,o,a){var s=e+(t&i|r&~i)+n+a;return(s<>>32-o)+t}function h(e,t,r,i,n,o,a){var s=e+(t^r^i)+n+a;return(s<>>32-o)+t}function l(e,t,r,i,n,o,a){var s=e+(r^(t|~i))+n+a;return(s<>>32-o)+t}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5},"object"==typeof _$md5_291?_$md5_291=_$md5_291=__factory_291(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_291):__factory_291(__root_291.CryptoJS);var _$sha1_307={},__root_307,__factory_307;__root_307=this,__factory_307=function(e){var t,r,i,n,o,a,s;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,o=t.algo,a=[],s=o.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],c=r[4],u=0;u<80;u++){if(u<16)a[u]=0|e[t+u];else{var f=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=f<<1|f>>>31}var h=(i<<5|i>>>27)+c+a[u];h+=u<20?1518500249+(n&o|~n&s):u<40?1859775393+(n^o^s):u<60?(n&o|n&s|o&s)-1894007588:(n^o^s)-899497514,c=s,s=o,o=n<<30|n>>>2,n=i,i=h}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=n._createHelper(s),t.HmacSHA1=n._createHmacHelper(s),e.SHA1},"object"==typeof _$sha1_307?_$sha1_307=_$sha1_307=__factory_307(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_307):__factory_307(__root_307.CryptoJS);var _$sha256_309={},__root_309,__factory_309;__root_309=this,__factory_309=function(e){return function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,a=r.algo,s=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var i=2,n=0;n<64;)e(i)&&(n<8&&(s[n]=r(t.pow(i,.5))),c[n]=r(t.pow(i,1/3)),n++),i++}();var u=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],f=r[5],h=r[6],l=r[7],_=0;_<64;_++){if(_<16)u[_]=0|e[t+_];else{var d=u[_-15],p=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,m=u[_-2],b=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[_]=p+u[_-7]+b+u[_-16]}var g=i&n^i&o^n&o,y=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),v=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&h)+c[_]+u[_];l=h,h=f,f=s,s=a+v|0,a=o,o=n,n=i,i=v+(y+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(f),r.HmacSHA256=o._createHmacHelper(f)}(Math),e.SHA256},"object"==typeof _$sha256_309?_$sha256_309=_$sha256_309=__factory_309(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_309):__factory_309(__root_309.CryptoJS);var _$sha224_308={},__root_308,__factory_308;__root_308=this,__factory_308=function(e){var t,r,i,n,o;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,o=i.SHA224=n.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=n._createHelper(o),t.HmacSHA224=n._createHmacHelper(o),e.SHA224},"object"==typeof _$sha224_308?_$sha224_308=_$sha224_308=__factory_308(_$core_283,_$sha256_309):"function"==typeof define&&define.amd?define(["./core","./sha256"],__factory_308):__factory_308(__root_308.CryptoJS);var _$sha512_312={},__root_312,__factory_312;__root_312=this,__factory_312=function(e){return function(){var t=e,r=t.lib.Hasher,i=t.x64,n=i.Word,o=i.WordArray,a=t.algo;function s(){return n.create.apply(n,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var f=a.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],f=r[5],h=r[6],l=r[7],_=i.high,d=i.low,p=n.high,m=n.low,b=o.high,g=o.low,y=a.high,v=a.low,w=s.high,$=s.low,E=f.high,S=f.low,A=h.high,B=h.low,k=l.high,M=l.low,T=_,R=d,I=p,P=m,x=b,O=g,C=y,N=v,L=w,D=$,U=E,H=S,j=A,z=B,q=k,K=M,F=0;F<80;F++){var G,V,W=u[F];if(F<16)V=W.high=0|e[t+2*F],G=W.low=0|e[t+2*F+1];else{var Y=u[F-15],J=Y.high,X=Y.low,Z=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=u[F-2],te=ee.high,re=ee.low,ie=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ne=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[F-7],ae=oe.high,se=oe.low,ce=u[F-16],ue=ce.high,fe=ce.low;V=(V=(V=Z+ae+((G=Q+se)>>>0>>0?1:0))+ie+((G+=ne)>>>0>>0?1:0))+ue+((G+=fe)>>>0>>0?1:0),W.high=V,W.low=G}var he,le=L&U^~L&j,_e=D&H^~D&z,de=T&I^T&x^I&x,pe=R&P^R&O^P&O,me=(T>>>28|R<<4)^(T<<30|R>>>2)^(T<<25|R>>>7),be=(R>>>28|T<<4)^(R<<30|T>>>2)^(R<<25|T>>>7),ge=(L>>>14|D<<18)^(L>>>18|D<<14)^(L<<23|D>>>9),ye=(D>>>14|L<<18)^(D>>>18|L<<14)^(D<<23|L>>>9),ve=c[F],we=ve.high,$e=ve.low,Ee=q+ge+((he=K+ye)>>>0>>0?1:0),Se=be+pe;q=j,K=z,j=U,z=H,U=L,H=D,L=C+(Ee=(Ee=(Ee=Ee+le+((he+=_e)>>>0<_e>>>0?1:0))+we+((he+=$e)>>>0<$e>>>0?1:0))+V+((he+=G)>>>0>>0?1:0))+((D=N+he|0)>>>0>>0?1:0)|0,C=x,N=O,x=I,O=P,I=T,P=R,T=Ee+(me+de+(Se>>>0>>0?1:0))+((R=he+Se|0)>>>0>>0?1:0)|0}d=i.low=d+R,i.high=_+T+(d>>>0>>0?1:0),m=n.low=m+P,n.high=p+I+(m>>>0

>>0?1:0),g=o.low=g+O,o.high=b+x+(g>>>0>>0?1:0),v=a.low=v+N,a.high=y+C+(v>>>0>>0?1:0),$=s.low=$+D,s.high=w+L+($>>>0>>0?1:0),S=f.low=S+H,f.high=E+U+(S>>>0>>0?1:0),B=h.low=B+z,h.high=A+j+(B>>>0>>0?1:0),M=l.low=M+K,l.high=k+q+(M>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(i+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(f),t.HmacSHA512=r._createHmacHelper(f)}(),e.SHA512},"object"==typeof _$sha512_312?_$sha512_312=_$sha512_312=__factory_312(_$core_283,_$x64Core_314):"function"==typeof define&&define.amd?define(["./core","./x64-core"],__factory_312):__factory_312(__root_312.CryptoJS);var _$sha384_311={},__root_311,__factory_311;__root_311=this,__factory_311=function(e){var t,r,i,n,o,a,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new n.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s),e.SHA384},"object"==typeof _$sha384_311?_$sha384_311=_$sha384_311=__factory_311(_$core_283,_$x64Core_314,_$sha512_312):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],__factory_311):__factory_311(__root_311.CryptoJS);var _$sha3_310={},__root_310,__factory_310;__root_310=this,__factory_310=function(e){return function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,a=r.x64.Word,s=r.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var i=(2*e+3*t)%5;e=t%5,t=i}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,o=0;o<24;o++){for(var s=0,h=0,l=0;l<7;l++){if(1&n){var _=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(M=r[n]).high^=a,M.low^=o}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var _=0,d=0,p=0;p<5;p++)_^=(M=r[l+5*p]).high,d^=M.low;var m=h[l];m.high=_,m.low=d}for(l=0;l<5;l++){var b=h[(l+4)%5],g=h[(l+1)%5],y=g.high,v=g.low;for(_=b.high^(y<<1|v>>>31),d=b.low^(v<<1|y>>>31),p=0;p<5;p++)(M=r[l+5*p]).high^=_,M.low^=d}for(var w=1;w<25;w++){var $=(M=r[w]).high,E=M.low,S=c[w];S<32?(_=$<>>32-S,d=E<>>32-S):(_=E<>>64-S,d=$<>>64-S);var A=h[u[w]];A.high=_,A.low=d}var B=h[0],k=r[0];for(B.high=k.high,B.low=k.low,l=0;l<5;l++)for(p=0;p<5;p++){var M=r[w=l+5*p],T=h[w],R=h[(l+1)%5+5*p],I=h[(l+2)%5+5*p];M.high=T.high^~R.high&I.high,M.low=T.low^~R.low&I.low}M=r[0];var P=f[s];M.high^=P.high,M.low^=P.low}},_doFinalize:function(){var e=this._data,r=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f>>24)|4278255360&(l<<24|l>>>8),_=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),u.push(_),u.push(l)}return new n.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(l),r.HmacSHA3=o._createHmacHelper(l)}(Math),e.SHA3},"object"==typeof _$sha3_310?_$sha3_310=_$sha3_310=__factory_310(_$core_283,_$x64Core_314):"function"==typeof define&&define.amd?define(["./core","./x64-core"],__factory_310):__factory_310(__root_310.CryptoJS);var _$ripemd160_306={},__root_306,__factory_306;__root_306=this,__factory_306=function(e){return function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,a=r.algo,s=n.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]),c=n.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]),u=n.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]),f=n.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]),h=n.create([0,1518500249,1859775393,2400959708,2840853838]),l=n.create([1352829926,1548603684,1836072691,2053994217,0]),_=a.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,a,_,v,w,$,E,S,A,B,k,M=this._hash.words,T=h.words,R=l.words,I=s.words,P=c.words,x=u.words,O=f.words;for($=o=M[0],E=a=M[1],S=_=M[2],A=v=M[3],B=w=M[4],r=0;r<80;r+=1)k=o+e[t+I[r]]|0,k+=r<16?d(a,_,v)+T[0]:r<32?p(a,_,v)+T[1]:r<48?m(a,_,v)+T[2]:r<64?b(a,_,v)+T[3]:g(a,_,v)+T[4],k=(k=y(k|=0,x[r]))+w|0,o=w,w=v,v=y(_,10),_=a,a=k,k=$+e[t+P[r]]|0,k+=r<16?g(E,S,A)+R[0]:r<32?b(E,S,A)+R[1]:r<48?m(E,S,A)+R[2]:r<64?p(E,S,A)+R[3]:d(E,S,A)+R[4],k=(k=y(k|=0,O[r]))+B|0,$=B,B=A,A=y(S,10),S=E,E=k;k=M[1]+_+A|0,M[1]=M[2]+v+B|0,M[2]=M[3]+w+$|0,M[3]=M[4]+o+E|0,M[4]=M[0]+a+S|0,M[0]=k},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var n=this._hash,o=n.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r){return e^t^r}function p(e,t,r){return e&t|~e&r}function m(e,t,r){return(e|~t)^r}function b(e,t,r){return e&r|t&~r}function g(e,t,r){return e^(t|~r)}function y(e,t){return e<>>32-t}r.RIPEMD160=o._createHelper(_),r.HmacRIPEMD160=o._createHmacHelper(_)}(Math),e.RIPEMD160},"object"==typeof _$ripemd160_306?_$ripemd160_306=_$ripemd160_306=__factory_306(_$core_283):"function"==typeof define&&define.amd?define(["./core"],__factory_306):__factory_306(__root_306.CryptoJS);var _$hmac_288={},__root_288,__factory_288;__root_288=this,__factory_288=function(e){var t,r,i;r=(t=e).lib.Base,i=t.enc.Utf8,t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u>>2];e.sigBytes-=t}},p=(i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:_,padding:d}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),i.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),m=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(c)},parse:function(e){var t,r=c.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),p.create({ciphertext:r,salt:t})}},b=i.SerializableCipher=n.extend({cfg:n.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),o=n.finalize(t),a=n.cfg;return p.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(r.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=o.random(8));var n=u.create({keySize:t+r}).compute(e,i),a=o.create(n.words.slice(t),4*r);return n.sigBytes=4*t,p.create({key:n,iv:a,salt:i})}},y=i.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:g}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize);i.iv=n.iv;var o=b.encrypt.call(this,e,t,n.key,i);return o.mixIn(n),o},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=n.iv,b.decrypt.call(this,e,t,n.key,i)}})}()},"object"==typeof _$cipherCore_282?_$cipherCore_282=_$cipherCore_282=__factory_282(_$core_283,_$evpkdf_286):"function"==typeof define&&define.amd?define(["./core","./evpkdf"],__factory_282):__factory_282(__root_282.CryptoJS);var _$modeCfb_292={},__root_292,__factory_292;__root_292=this,__factory_292=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function r(e,t,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,i=255&e;255===t?(t=0,255===r?(r=0,255===i?i=0:++i):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=i}else e+=1<<24;return e}var i=t.Encryptor=t.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=r(e[0]))&&(e[1]=r(e[1]))}(a);var s=a.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-o%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"==typeof _$padAnsix923_297?_$padAnsix923_297=_$padAnsix923_297=__factory_297(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_297):__factory_297(__root_297.CryptoJS);var _$padIso10126_298={},__root_298,__factory_298;__root_298=this,__factory_298=function(e){return e.pad.Iso10126={pad:function(t,r){var i=4*r,n=i-t.sigBytes%i;t.concat(e.lib.WordArray.random(n-1)).concat(e.lib.WordArray.create([n<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126},"object"==typeof _$padIso10126_298?_$padIso10126_298=_$padIso10126_298=__factory_298(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_298):__factory_298(__root_298.CryptoJS);var _$padIso97971_299={},__root_299,__factory_299;__root_299=this,__factory_299=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},"object"==typeof _$padIso97971_299?_$padIso97971_299=_$padIso97971_299=__factory_299(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_299):__factory_299(__root_299.CryptoJS);var _$padZeropadding_301={},__root_301,__factory_301;__root_301=this,__factory_301=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){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding},"object"==typeof _$padZeropadding_301?_$padZeropadding_301=_$padZeropadding_301=__factory_301(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_301):__factory_301(__root_301.CryptoJS);var _$padNopadding_300={},__root_300,__factory_300;__root_300=this,__factory_300=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"==typeof _$padNopadding_300?_$padNopadding_300=_$padNopadding_300=__factory_300(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_300):__factory_300(__root_300.CryptoJS);var _$formatHex_287={},__root_287,__factory_287;__root_287=this,__factory_287=function(e){var t,r,i;return r=(t=e).lib.CipherParams,i=t.enc.Hex,t.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}},e.format.Hex},"object"==typeof _$formatHex_287?_$formatHex_287=_$formatHex_287=__factory_287(_$core_283,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],__factory_287):__factory_287(__root_287.CryptoJS);var _$aes_281={},__root_281,__factory_281;__root_281=this,__factory_281=function(e){return function(){var t=e,r=t.lib.BlockCipher,i=t.algo,n=[],o=[],a=[],s=[],c=[],u=[],f=[],h=[],l=[],_=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,i=0;for(t=0;t<256;t++){var d=i^i<<1^i<<2^i<<3^i<<4;d=d>>>8^255&d^99,n[r]=d,o[d]=r;var p=e[r],m=e[p],b=e[m],g=257*e[d]^16843008*d;a[r]=g<<24|g>>>8,s[r]=g<<16|g>>>16,c[r]=g<<8|g>>>24,u[r]=g,g=16843009*b^65537*m^257*p^16843008*r,f[d]=g<<24|g>>>8,h[d]=g<<16|g>>>16,l[d]=g<<8|g>>>24,_[d]=g,r?(r=p^e[e[e[b^p]]],i^=e[e[i]]):r=i=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],p=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(u=n[u>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u]):(u=n[(u=u<<8|u>>>24)>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u],u^=d[a/r|0]<<24),o[a]=o[a-r]^u);for(var s=this._invKeySchedule=[],c=0;c>>24]]^h[n[u>>>16&255]]^l[n[u>>>8&255]]^_[n[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,n)},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,f,h,l,_,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,a,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],_=4,d=1;d>>24]^n[f>>>16&255]^o[h>>>8&255]^a[255&l]^r[_++],m=i[f>>>24]^n[h>>>16&255]^o[l>>>8&255]^a[255&u]^r[_++],b=i[h>>>24]^n[l>>>16&255]^o[u>>>8&255]^a[255&f]^r[_++],g=i[l>>>24]^n[u>>>16&255]^o[f>>>8&255]^a[255&h]^r[_++];u=p,f=m,h=b,l=g}p=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^r[_++],m=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^r[_++],b=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[_++],g=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^r[_++],e[t]=p,e[t+1]=m,e[t+2]=b,e[t+3]=g},keySize:8});t.AES=r._createHelper(p)}(),e.AES},"object"==typeof _$aes_281?_$aes_281=_$aes_281=__factory_281(_$core_283,_$encBase64_284,_$md5_291,_$evpkdf_286,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],__factory_281):__factory_281(__root_281.CryptoJS);var _$tripledes_313={},__root_313,__factory_313;__root_313=this,__factory_313=function(e){return function(){var t=e,r=t.lib,i=r.WordArray,n=r.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=n.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=a[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){var u=n[o]=[],f=c[o];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=n[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],l.call(this,4,252645135),l.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),l.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^n[c])&f[c])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,l.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(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<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),n=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(i.create(t)),this._des2=h.createEncryptor(i.create(r)),this._des3=h.createEncryptor(i.create(n))},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});t.TripleDES=n._createHelper(d)}(),e.TripleDES},"object"==typeof _$tripledes_313?_$tripledes_313=_$tripledes_313=__factory_313(_$core_283,_$encBase64_284,_$md5_291,_$evpkdf_286,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],__factory_313):__factory_313(__root_313.CryptoJS);var _$rc4_305={},__root_305,__factory_305;__root_305=this,__factory_305=function(e){return function(){var t=e,r=t.lib.StreamCipher,i=t.algo,n=i.RC4=r.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var o=0;n<256;n++){var a=n%r,s=t[a>>>2]>>>24-a%4*8&255;o=(o+i[n]+s)%256;var c=i[n];i[n]=i[o],i[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}t.RC4=r._createHelper(n);var a=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=r._createHelper(a)}(),e.RC4},"object"==typeof _$rc4_305?_$rc4_305=_$rc4_305=__factory_305(_$core_283,_$encBase64_284,_$md5_291,_$evpkdf_286,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],__factory_305):__factory_305(__root_305.CryptoJS);var _$rabbit_304={},__root_304,__factory_304;__root_304=this,__factory_304=function(e){return function(){var t=e,r=t.lib.StreamCipher,i=t.algo,n=[],o=[],a=[],s=i.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>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],n=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]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=f,n[3]^=l,n[4]^=u,n[5]^=h,n[6]^=f,n[7]^=l,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(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,r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,s=i>>>16,c=((n*n>>>17)+n*s>>>15)+s*s,u=((4294901760&i)*i|0)+((65535&i)*i|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=r._createHelper(s)}(),e.Rabbit},"object"==typeof _$rabbit_304?_$rabbit_304=_$rabbit_304=__factory_304(_$core_283,_$encBase64_284,_$md5_291,_$evpkdf_286,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],__factory_304):__factory_304(__root_304.CryptoJS);var _$rabbitLegacy_303={},__root_303,__factory_303;__root_303=this,__factory_303=function(e){return function(){var t=e,r=t.lib.StreamCipher,i=t.algo,n=[],o=[],a=[],s=i.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=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 n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=f,i[3]^=l,i[4]^=u,i[5]^=h,i[6]^=f,i[7]^=l,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(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,r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,s=i>>>16,c=((n*n>>>17)+n*s>>>15)+s*s,u=((4294901760&i)*i|0)+((65535&i)*i|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=r._createHelper(s)}(),e.RabbitLegacy},"object"==typeof _$rabbitLegacy_303?_$rabbitLegacy_303=_$rabbitLegacy_303=__factory_303(_$core_283,_$encBase64_284,_$md5_291,_$evpkdf_286,_$cipherCore_282):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],__factory_303):__factory_303(__root_303.CryptoJS);var _$cryptoJs_289={},__root_289,__factory_289;__root_289=this,__factory_289=function(e){return e},"object"==typeof _$cryptoJs_289?_$cryptoJs_289=_$cryptoJs_289=__factory_289(_$core_283,_$x64Core_314,_$libTypedarrays_290,_$encUtf16_285,_$encBase64_284,_$md5_291,_$sha1_307,_$sha256_309,_$sha224_308,_$sha512_312,_$sha384_311,_$sha3_310,_$ripemd160_306,_$hmac_288,_$pbkdf2_302,_$evpkdf_286,_$cipherCore_282,_$modeCfb_292,_$modeCtr_294,_$modeCtrGladman_293,_$modeOfb_296,_$modeEcb_295,_$padAnsix923_297,_$padIso10126_298,_$padIso97971_299,_$padZeropadding_301,_$padNopadding_300,_$formatHex_287,_$aes_281,_$tripledes_313,_$rc4_305,_$rabbit_304,_$rabbitLegacy_303):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],__factory_289):__root_289.CryptoJS=__factory_289(__root_289.CryptoJS);const orgs=[{org:"psf",description:"Permissionless Software Foundation",website:"https://psfoundation.cash",addresses:{donations:"bitcoincash:qqsrke9lh257tqen99dkyy2emh4uty0vky9y0z0lsr"}},{org:"abc",description:"Bitcoin ABC",website:"https://www.bitcoinabc.org/",addresses:{donations:"bitcoincash:qqeht8vnwag20yv8dvtcrd4ujx09fwxwsqqqw93w88"}},{org:"bchd",description:"BCHD full node in Go",website:"https://bchd.cash/",addresses:{donations:"bitcoincash:qrhea03074073ff3zv9whh0nggxc7k03ssh8jv9mkx"}}];var _$bchDonation_185=function(e){const t=orgs.filter(t=>t.org===e);if(!t)throw new Error("Could not find an organization with that handle.");if(t.length>1)throw new Error("Multiple organizations were found!");return t[0].addresses};const PSF_DONATION=2e3;var _$sendBch_4=class{constructor(e={}){if(this.bchjs=e.bchjs,!this.bchjs)throw new Error("Must pass instance of bch-js when instantiating SendBCH.");if(this.ar=e.ar,!this.ar)throw new Error("Must pass instance of Adapter Router.");this.restURL=e.restURL,this.apiToken=e.apiToken}async sendBch(e,t,r){try{const i=await this.createTransaction(e,t,r);return await this.ar.sendTx(i.hex)}catch(err){throw console.error("Error in send-bch.js/sendBch()"),err}}async createTransaction(e,t,r){try{if(!r||0===r.length)throw new Error("UTXO list is empty");t.fee||(t.fee=1);const{necessaryUtxos:i,change:n}=this.getNecessaryUtxosAndChange(e,r,t.fee),o=new this.bchjs.TransactionBuilder;i.forEach(e=>{o.addInput(e.tx_hash,e.tx_pos)}),e.forEach(e=>{o.addOutput(e.address,e.amountSat)}),o.addOutput(_$bchDonation_185("psf").donations,PSF_DONATION),n&&n>546&&o.addOutput(t.cashAddress,n);const a=await this.getKeyPairFromMnemonic(t);i.forEach((e,t)=>{o.sign(t,a,void 0,o.hashTypes.SIGHASH_ALL,e.value)});const s=o.build();return{hex:s.toHex(),txid:s.getId()}}catch(err){throw console.error("Error in send-bch.js/createTransaction()"),err}}getNecessaryUtxosAndChange(e,t,r=1){const i=this.sortUtxosBySize(t,"ASCENDING"),n=this.calculateFee(0,e.length+1,r);let o=e.reduce((e,t)=>e+t.amountSat,0)+n+PSF_DONATION,a=0;const s=[];for(const u of i)if(s.push(u),(a+=u.value)>=(o+=148))break;const c=a-o;if(c<0)throw console.error(`Available satoshis (${a}) below needed satoshis (${o}).`),new Error("Insufficient balance");return{necessaryUtxos:s,change:c}}sortUtxosBySize(e,t="ASCENDING"){return"ASCENDING"===t?e.sort((e,t)=>e.value-t.value):e.sort((e,t)=>t.value-e.value)}calculateFee(e,t,r){try{const i=this.bchjs.BitcoinCash.getByteCount({P2PKH:e},{P2PKH:t+1}),n=Math.ceil(i*r);if(isNaN(n))throw new Error("Invalid input. Fee could not be calculated.");return n}catch(err){throw console.error("Error in send-bch.js/calculateFee()"),err}}async getKeyPairFromMnemonic(e){if(e.mnemonic){const t=await this.bchjs.Mnemonic.toSeed(e.mnemonic),r=this.bchjs.HDNode.fromSeed(t),i=this.bchjs.HDNode.derivePath(r,e.hdPath);return this.bchjs.HDNode.toKeyPair(i)}return this.bchjs.ECPair.fromWIF(e.privateKey)}async sendAllBch(e,t,r){try{const i=await this.createSendAllTx(e,t,r);return await this.ar.sendTx(i.hex)}catch(err){throw console.error("Error in send-bch.js/sendAllBch()"),err}}async createSendAllTx(e,t,r){try{if(!e||"string"!=typeof e)throw new Error("Address to send must be a bch address");if(!r||0===r.length)throw new Error("UTXO list is empty");const i=new this.bchjs.TransactionBuilder;t.fee||(t.fee=1);const n=t.fee;let o=0,a=this.calculateFee(0,2,n);a+=PSF_DONATION,r.forEach(e=>{o+=e.value,a+=148,i.addInput(e.tx_hash,e.tx_pos)}),i.addOutput(e,o-a),i.addOutput(_$bchDonation_185("psf").donations,PSF_DONATION);const s=await this.getKeyPairFromMnemonic(t);r.forEach((e,t)=>{i.sign(t,s,void 0,i.hashTypes.SIGHASH_ALL,e.value)});const c=i.build();return{hex:c.toHex(),txid:c.getId()}}catch(err){throw console.error("Error in send-bch.js/createSendAllTx()"),err}}},_$utxos_6=class{constructor(e={}){if(this.bchjs=e.bchjs,!this.bchjs)throw new Error("Must pass instance of bch-js when instantiating AdapterRouter.");if(this.ar=e.ar,!this.ar)throw new Error("Must pass instance of Adapter Router.");this.utxoStore=[],this.temp=[]}async initUtxoStore(e){try{this.utxoStore=[];const t=await this.ar.getUtxos(e);if(t.status>399)throw new Error(t.message);return this.utxoStore=t,this.utxoStore}catch(err){throw console.error("Error in utxos.js/initUtxoStore()"),err}}getSpendableTokenUtxos(){try{return this.utxoStore.slpUtxos.type1.tokens.concat(this.utxoStore.slpUtxos.nft.tokens,this.utxoStore.slpUtxos.group.tokens)}catch(err){throw console.error("Error in utxos.js/getSpendableTokenUtxos()"),err}}},_$tokens_5={};(function(e){(function(){_$tokens_5=class{constructor(e={}){if(this.bchjs=e.bchjs,!this.bchjs)throw new Error("Must pass instance of bch-js when instantiating AdapterRouter.");if(this.ar=e.ar,!this.ar)throw new Error("Must pass instance of Adapter Router.");this.sendBch=new _$sendBch_4(e),this.utxos=new _$utxos_6(e)}async listTokensFromAddress(e){try{if(!e)throw new Error("Address not provided");e=this.bchjs.SLP.Address.toCashAddress(e),await this.utxos.initUtxoStore(e);const t=this.utxos.getSpendableTokenUtxos();return this.listTokensFromUtxos(t)}catch(err){throw console.error("Error in tokens.js/listTokensFromAddress()"),err}}listTokensFromUtxos(e){try{const t=[];return e.forEach(e=>{if(!e.isSlp||"token"!==e.type)return;const r=t.findIndex(t=>t.tokenId===e.tokenId);if(r<0){const r={tokenId:e.tokenId,ticker:e.ticker,name:e.name,decimals:e.decimals,tokenType:e.tokenType,url:e.documentUri,qty:Number(e.qtyStr)};t.push(r)}else t[r].qty+=Number(e.qtyStr)}),t}catch(err){throw console.error("Error in tokens.js/listTokensFromUtxos()"),err}}async sendTokens(e,t,r,i,n=1){try{const o=await this.createTransaction(e,t,r,i,n);return await this.ar.sendTx(o.hex)}catch(err){throw console.error("Error in tokens.js/sendTokens()"),err}}async createTransaction(t,r,i,n,o=1){try{if(!i||0===i.length)throw new Error("BCH UTXO list is empty");if(!n||0===n.length)throw new Error("Token UTXO list is empty");const a=t.tokenId;if(0===(n=n.filter(e=>e.tokenId===a&&"token"===e.type)).length)throw new Error(`Token UTXO with token ID ${a} not found!`);const s=[{address:r.cashAddress,amountSat:500+50*o}],{necessaryUtxos:c,change:u}=this.sendBch.getNecessaryUtxosAndChange(s,i,o),f=new this.bchjs.TransactionBuilder;n.forEach(e=>{f.addInput(e.tx_hash,e.tx_pos)}),c.forEach(e=>{f.addInput(e.tx_hash,e.tx_pos)}),n=n.map(e=>(e.tokenQty=parseFloat(e.qtyStr),e));let h={};if(1===n[0].tokenType)h=await this.bchjs.SLP.TokenType1.generateSendOpReturn(n,t.qty);else if(65===n[0].tokenType)h=await this.bchjs.SLP.NFT1.generateNFTChildSendOpReturn(n,t.qty);else{if(129!==n[0].tokenType)throw new Error(`Token Type ${n[0].tokenType} unknown`);h=await this.bchjs.SLP.NFT1.generateNFTGroupSendOpReturn(n,t.qty)}const l=e.from(h.script,"hex");f.addOutput(l,0),f.addOutput(this.bchjs.SLP.Address.toLegacyAddress(t.address),546),h.outputs>1&&f.addOutput(this.bchjs.SLP.Address.toLegacyAddress(r.address),546),f.addOutput(_$bchDonation_185("psf").donations,2e3),u&&u>546&&f.addOutput(r.cashAddress,u);const _=await this.sendBch.getKeyPairFromMnemonic(r);n.forEach((e,t)=>{f.sign(t,_,void 0,f.hashTypes.SIGHASH_ALL,e.value)}),c.forEach((e,t)=>{f.sign(n.length+t,_,void 0,f.hashTypes.SIGHASH_ALL,e.value)});const d=f.build();return{hex:d.toHex(),txid:d.getId()}}catch(err){throw console.error("Error in tokens.js/createTransaction()"),err}}async createBurnTransaction(e,t,r,i,n,o=1){try{if(!e||"number"!=typeof e)throw new Error("qty must be number");if(!t||"string"!=typeof t)throw new Error("tokenId must be string");if(!r||"object"!=typeof r)throw new Error("walletInfo must be a object");if(!i||0===i.length)throw new Error("BCH UTXO list is empty");if(!n||0===n.length)throw new Error("Token UTXO list is empty");if(!(n=n.filter(e=>e.tokenId===t&&"token"===e.type)).length)throw new Error("tokenId does not match");const a=[{address:r.cashAddress,amountSat:500+50*o}],{necessaryUtxos:s,change:c}=this.sendBch.getNecessaryUtxosAndChange(a,i,o),u=new this.bchjs.TransactionBuilder;n.forEach(e=>{u.addInput(e.tx_hash,e.tx_pos)}),s.forEach(e=>{u.addInput(e.tx_hash,e.tx_pos)}),n.map(e=>(e.tokenQty=e.qtyStr,e));const f=await this.bchjs.SLP.TokenType1.generateBurnOpReturn(n,e);u.addOutput(f,0),u.addOutput(this.bchjs.SLP.Address.toLegacyAddress(r.address),546),u.addOutput(_$bchDonation_185("psf").donations,2e3),c&&c>546&&u.addOutput(r.cashAddress,c);const h=await this.sendBch.getKeyPairFromMnemonic(r);n.forEach((e,t)=>{u.sign(t,h,void 0,u.hashTypes.SIGHASH_ALL,e.value)}),s.forEach((e,t)=>{u.sign(n.length+t,h,void 0,u.hashTypes.SIGHASH_ALL,e.value)});const l=u.build();return{hex:l.toHex(),txid:l.getId()}}catch(err){throw console.error("Error in tokens.js/createBurnTransaction()"),err}}async burnTokens(e,t,r,i,n,o=1){try{const a=await this.createBurnTransaction(e,t,r,i,n,o);return await this.ar.sendTx(a.hex)}catch(err){throw console.error("Error in tokens.js/burnTokens()"),err}}async burnAll(e,t,r,i){try{if(!e||"string"!=typeof e)throw new Error("tokenId must be a string");if(!t||"object"!=typeof t)throw new Error("walletInfo is required");if(!r||0===r.length)throw new Error("BCH UTXO list is empty");if(!i||0===i.length)throw new Error("SLP UTXO list is empty");if(0===(i=i.filter(t=>t.tokenId===e&&"token"===t.type)).length)throw new Error("No token UTXOs found to burn after filtering, for token ID "+e);const n=i.concat(r);return await this.sendBch.sendAllBch(t.cashAddress,t,n)}catch(err){throw console.error("Error in tokens.js/burnAll()"),err}}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$bind_173=function(e,t){return function(){for(var r=new Array(arguments.length),i=0;i=0)return;n[t]="set-cookie"===t?(n[t]?n[t]:[]).concat([r]):n[t]?n[t]+", "+r:r}})),n):n},_$isURLSameOrigin_179=_$utils_184.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var i=e;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=_$utils_184.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},_$Cancel_159={};function __Cancel_159(e){this.message=e}__Cancel_159.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},__Cancel_159.prototype.__CANCEL__=!0,_$Cancel_159=__Cancel_159;var __defaults_170=_$defaults_171({}),_$transformData_170=function(e,t,r){var i=this||__defaults_170;return _$utils_184.forEach(r,(function(r){e=r.call(i,e,t)})),e},_$isCancel_161=function(e){return!(!e||!e.__CANCEL__)},__defaults_166=_$defaults_171({});function __throwIfCancellationRequested_166(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _$Cancel_159("canceled")}var _$dispatchRequest_166=function(e){return __throwIfCancellationRequested_166(e),e.headers=e.headers||{},e.data=_$transformData_170.call(e,e.data,e.headers,e.transformRequest),e.headers=_$utils_184.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_$utils_184.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||__defaults_166.adapter)(e).then((function(t){return __throwIfCancellationRequested_166(e),t.data=_$transformData_170.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return _$isCancel_161(t)||(__throwIfCancellationRequested_166(e),t&&t.response&&(t.response.data=_$transformData_170.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},_$mergeConfig_168=function(e,t){t=t||{};var r={};function i(e,t){return _$utils_184.isPlainObject(e)&&_$utils_184.isPlainObject(t)?_$utils_184.merge(e,t):_$utils_184.isPlainObject(t)?_$utils_184.merge({},t):_$utils_184.isArray(t)?t.slice():t}function n(r){return _$utils_184.isUndefined(t[r])?_$utils_184.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function o(e){if(!_$utils_184.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return _$utils_184.isUndefined(t[r])?_$utils_184.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function s(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return _$utils_184.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||n,i=t(e);_$utils_184.isUndefined(i)&&t!==s||(r[e]=i)})),r},_$data_172={version:"0.25.0"},_$validator_183={},__VERSION_183=_$data_172.version,__validators_183={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){__validators_183[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var __deprecatedWarnings_183={};__validators_183.transitional=function(e,t,r){function i(e,t){return"[Axios v"+__VERSION_183+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!__deprecatedWarnings_183[n]&&(__deprecatedWarnings_183[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},_$validator_183={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var i=Object.keys(e),n=i.length;n-- >0;){var o=i[n],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:__validators_183};var _$Axios_162={},__validators_162=_$validator_183.validators;function __Axios_162(e){this.defaults=e,this.interceptors={request:new _$InterceptorManager_163,response:new _$InterceptorManager_163}}__Axios_162.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=_$mergeConfig_168(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&_$validator_183.assertOptions(r,{silentJSONParsing:__validators_162.transitional(__validators_162.boolean),forcedJSONParsing:__validators_162.transitional(__validators_162.boolean),clarifyTimeoutError:__validators_162.transitional(__validators_162.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var o,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!n){var s=[_$dispatchRequest_166,void 0];for(Array.prototype.unshift.apply(s,i),s=s.concat(a),o=Promise.resolve(t);s.length;)o=o.then(s.shift(),s.shift());return o}for(var c=t;i.length;){var u=i.shift(),f=i.shift();try{c=u(c)}catch(h){f(h);break}}try{o=_$dispatchRequest_166(c)}catch(h){return Promise.reject(h)}for(;a.length;)o=o.then(a.shift(),a.shift());return o},__Axios_162.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=_$mergeConfig_168(this.defaults,e),_$buildURL_174(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},_$utils_184.forEach(["delete","get","head","options"],(function(e){__Axios_162.prototype[e]=function(t,r){return this.request(_$mergeConfig_168(r||{},{method:e,url:t,data:(r||{}).data}))}})),_$utils_184.forEach(["post","put","patch"],(function(e){__Axios_162.prototype[e]=function(t,r,i){return this.request(_$mergeConfig_168(i||{},{method:e,url:t,data:r}))}})),_$Axios_162=__Axios_162;var _$CancelToken_160={};function __CancelToken_160(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;this.promise.then((function(e){if(r._listeners){var t,i=r._listeners.length;for(t=0;te+t.amountSat,0)+o+2e3,s=0;const c=[];for(const f of n)if(c.push(f),(s+=f.value)>=(a+=148))break;const u=s-a;if(u<0)throw console.error(`Available satoshis (${s}) below needed satoshis (${a}).`),new Error("Insufficient balance");return{necessaryUtxos:c,change:u}}async createTransaction(t,r,i="",n="6d02",o=[],a=1){try{if(!r||0===r.length)throw new Error("BCH UTXO list is empty");const s=[this.bchjs.Script.opcodes.OP_RETURN,e.from(n,"hex"),e.from(i)],c=this.bchjs.Script.encode2(s),{necessaryUtxos:u,change:f}=this.getNecessaryUtxosAndChange(o,r,c.length,a),h=new this.bchjs.TransactionBuilder;u.forEach(e=>{h.addInput(e.tx_hash,e.tx_pos)}),h.addOutput(c,0),h.addOutput(_$bchDonation_185("psf").donations,2e3),f&&f>546&&h.addOutput(t.cashAddress,f);for(let e=0;e{h.sign(t,l,void 0,h.hashTypes.SIGHASH_ALL,e.value)});const _=h.build();return{hex:_.toHex(),txid:_.getId()}}catch(err){throw console.error("Error in op-return.js/createTransaction()"),err}}async sendOpReturn(e,t,r="",i="6d02",n=[],o=1){const{hex:a}=await this.createTransaction(e,t,r,i,n,o);return await this.ar.sendTx(a)}}}).call(this)}).call(this,_$buffer_267({}).Buffer);var _$minimalSlpWallet_1=class{constructor(e,t={}){this.advancedOptions=t,this.hdPath=this.advancedOptions.hdPath||"m/44'/245'/0'/0/0";const r={};this.advancedOptions.restURL&&(r.restURL=t.restURL),this.advancedOptions.apiToken&&(r.apiToken=t.apiToken),this.advancedOptions.authPass&&(r.authPass=t.authPass),this.fee=1.2,this.advancedOptions.fee&&(this.fee=this.advancedOptions.fee),this.noUpdate=!1,this.advancedOptions.noUpdate&&(this.noUpdate=!0),this.crypto=_$cryptoJs_289,this.BCHJS=_$bchJs_15,this.bchjs=new _$bchJs_15(r),r.bchjs=this.bchjs,"consumer-api"===t.interface&&(r.interface="consumer-api"),this.ar=new _$router_2(r),r.ar=this.ar,this.sendBch=new _$sendBch_4(r),this.utxos=new _$utxos_6(r),this.tokens=new _$tokens_5(r),this.opReturn=new _$opReturn_3(r),this.temp=[],this.walletInfoCreated=!1,this.walletInfoPromise=this.create(e)}async create(e){try{e&&this.advancedOptions.password&&(e=this.decrypt(e,this.advancedOptions.password));const t={};if(e){const r=e&&("k"===e[0].toString().toLowerCase()||"l"===e[0].toString().toLowerCase()),i=e&&52===e.length;if(r&&i){t.privateKey=e;const r=this.bchjs.ECPair.fromWIF(e);t.publicKey=this.bchjs.ECPair.toPublicKey(r).toString("hex"),t.mnemonic=null,t.address=t.cashAddress=this.bchjs.ECPair.toCashAddress(r),t.legacyAddress=this.bchjs.ECPair.toLegacyAddress(r),t.hdPath=null}else{const r=e||this.bchjs.Mnemonic.generate(128),i=await this.bchjs.Mnemonic.toSeed(r),n=this.bchjs.HDNode.fromSeed(i).derivePath(this.hdPath);t.privateKey=this.bchjs.HDNode.toWIF(n),t.publicKey=this.bchjs.HDNode.toPublicKey(n).toString("hex"),t.mnemonic=r,t.address=t.cashAddress=this.bchjs.HDNode.toCashAddress(n),t.legacyAddress=this.bchjs.HDNode.toLegacyAddress(n),t.hdPath=this.hdPath}}else{const e=this.bchjs.Mnemonic.generate(128),r=await this.bchjs.Mnemonic.toSeed(e),i=this.bchjs.HDNode.fromSeed(r).derivePath(this.hdPath);t.privateKey=this.bchjs.HDNode.toWIF(i),t.publicKey=this.bchjs.HDNode.toPublicKey(i).toString("hex"),t.mnemonic=e,t.address=t.cashAddress=this.bchjs.HDNode.toCashAddress(i),t.legacyAddress=this.bchjs.HDNode.toLegacyAddress(i),t.hdPath=this.hdPath}return this.advancedOptions.password&&(t.mnemonicEncrypted=this.encrypt(e,this.advancedOptions.password)),t.slpAddress=this.bchjs.SLP.Address.toSLPAddress(t.address),this.noUpdate||await this.utxos.initUtxoStore(t.address),this.walletInfoCreated=!0,this.walletInfo=t,t}catch(err){throw console.error("Error in create()"),err}}async getUtxos(e){let t=e;return!e&&this.walletInfo&&this.walletInfo.cashAddress?(t=this.walletInfo.cashAddress,this.utxos.initUtxoStore(t)):await this.ar.getUtxos(t)}encrypt(e,t){return this.crypto.AES.encrypt(e,t).toString()}decrypt(e,t){let r;try{r=this.crypto.AES.decrypt(e,t).toString(this.crypto.enc.Utf8)}catch(err){throw new Error("Wrong password")}return r}async getBalance(e){let t=e;!e&&this.walletInfo&&this.walletInfo.cashAddress&&(t=this.walletInfo.cashAddress);const r=await this.ar.getBalance(t);return r.balance.confirmed+r.balance.unconfirmed}async getTransactions(e){let t=e;return!e&&this.walletInfo&&this.walletInfo.cashAddress&&(t=this.walletInfo.cashAddress),(await this.ar.getTransactions(t)).transactions}async getTxData(e=[]){return await this.ar.getTxData(e)}send(e){try{return this.sendBch.sendBch(e,{mnemonic:this.walletInfo.mnemonic,cashAddress:this.walletInfo.address,hdPath:this.walletInfo.hdPath,fee:this.fee},this.utxos.utxoStore.bchUtxos)}catch(err){throw console.error("Error in send()"),err}}sendTokens(e,t){try{t||(t=this.fee),Array.isArray(e)&&(e=e[0]);const r=this.utxos.getSpendableTokenUtxos();return this.tokens.sendTokens(e,this.walletInfo,this.utxos.utxoStore.bchUtxos,r,t)}catch(err){throw console.error("Error in send()"),err}}async burnTokens(e,t,r){try{r||(r=this.fee);const i=this.utxos.getSpendableTokenUtxos();return this.tokens.burnTokens(e,t,this.walletInfo,this.utxos.utxoStore.bchUtxos,i,r)}catch(err){throw console.error("Error in burnTokens()"),err}}listTokens(e){const t=e||this.walletInfo.slpAddress;return this.tokens.listTokensFromAddress(t)}sendAll(e){try{return this.sendBch.sendAllBch(e,{mnemonic:this.walletInfo.mnemonic,cashAddress:this.walletInfo.address,hdPath:this.walletInfo.hdPath,fee:this.fee,privateKey:this.walletInfo.privateKey},this.utxos.utxoStore.bchUtxos)}catch(err){throw console.error("Error in sendAll()"),err}}async burnAll(e){try{const t=this.utxos.getSpendableTokenUtxos();return await this.tokens.burnAll(e,this.walletInfo,this.utxos.utxoStore.bchUtxos,t)}catch(err){throw console.error("Error in burnAll()"),err}}async getUsd(){return await this.ar.getUsd()}async sendOpReturn(e="",t="6d02",r=[],i=1){try{return await this.walletInfoPromise,await this.opReturn.sendOpReturn(this.walletInfo,this.utxos.utxoStore.bchUtxos,e,t,r,i)}catch(err){throw console.error("Error in sendOpReturn()"),err}}async utxoIsValid(e){return await this.ar.utxoIsValid(e)}async getTokenData(e,t=!1){return await this.ar.getTokenData(e,t)}};return _$minimalSlpWallet_1})); \ No newline at end of file diff --git a/public/penguin.jpeg b/public/penguin.jpeg new file mode 100644 index 0000000..89548d9 Binary files /dev/null and b/public/penguin.jpeg differ diff --git a/src/components/load-scripts.js b/src/components/load-scripts.js index 64e0847..9e65412 100644 --- a/src/components/load-scripts.js +++ b/src/components/load-scripts.js @@ -5,7 +5,10 @@ import useScript from '../hooks/use-script' function LoadScripts () { - useScript('https://unpkg.com/minimal-slp-wallet') + // useScript('https://unpkg.com/minimal-slp-wallet') + + // Load the libraries from the local directory. + useScript(`${process.env.PUBLIC_URL}/minimal-slp-wallet.min.js`) return true }